Hello all,
i have a .txt document with several million lines and I need to create a separate text files for each of these lines of text. So, the point is to end up with several million files, each containing one line of text, in a folder named Texts. Anyone have an idea how do this?
Thanks,
Dan
I'm not sure this is a good idea.
data _null_;
if _n_ eq 1 then rc = DCREATE('Texts','.');
infile cards;
input;
filename = cats('.\texts\temp',put(_n_,z12.),'.txt');
file dummy filevar=filename;
put _infile_;
cards4;
Hello all,
i have a .txt document with several million lines and
I need to create a separate text files for each of these
lines of text. So, the point is to end up with several
million files, each containing one line of text, in a
folder named Texts. Anyone have an idea how do this?
Thanks,
Dan
;;;;
run;
DN: Yes, I;m about 2 months late responding to this, but I am playing around with SAS text miner this afternoon, trying to analyze a bunch of emails, and its instructions suggest it is best to start with separate files for each email. I had created a SAS file containing all of the relevant info, but now am going to try it with separate txt files for each email. The code you suggested, in response to the OP's request, will be quite helpful.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.