0

Is there a way to print the contents of a .txt file to a tab using ods tagsets.excelxp? I have a script that creates a .xml file with several tabs, and on one of the tabs I'd like to print the lines of the code itself, so that I can send the .xml file to someone and they can have the code that I used to produce the output. I have the code saved separately as a .txt. Any help or suggestions would be appreciated.

Robert Penridge
  • 8,424
  • 2
  • 34
  • 55

1 Answers1

0

Easiest way would be to read the text file lines into a Data Set. Then use PROC PRINT to print to your output destination;

data lines;
infile "path/to/file.txt";
format code $2000.;
input;
code = _infile_;
run;

proc print data=lines noobs;
run;
DomPazz
  • 12,415
  • 17
  • 23