Text file

Accepted Solution Solved
Reply
Contributor
Posts: 68
Accepted Solution

Text file

Using inherited code, created a large (6.5m KB) text file, that is too large to open in notepad or word pad. It will be forwarded as a backup file to institutions requesting the data. How do I open it to view what they will receive or more to the point how will they open it?

I reviewed the set file but not meaningful. I want to review the file content. Help?


Accepted Solutions
Solution
‎12-11-2014 02:40 PM
Super User
Posts: 5,353

Re: Text file

I think what PG Stats is referring to is that you can mark the answers you receive as "Correct" or "Helpful".  Those who provide answers look forward to getting that form of feedback.

Here's a quick and dirty way to examine a portion of a file, using SAS:

data _null_;

  infile 'path to file';

  input;

  if _n_ < 1000 then list;

  else stop;

run;

You can easily change the range of rows to examine, such as:

if (20050 <= _n_ <= 20923) then list;

else if _n_ > 20923 then stop;

Good luck.

View solution in original post


All Replies
Respected Advisor
Posts: 4,804

Re: Text file

Given that no one ever provides a correct answer to your questions, I'm not even going to try. - PG

PG
Contributor
Posts: 68

Re: Text file

I am unsure about your response, but thank you for replying.

I have gotten many great answers and correct direction on this forum. If my gratefulness has not been clear, I readily provide now. Thanks again.

Solution
‎12-11-2014 02:40 PM
Super User
Posts: 5,353

Re: Text file

I think what PG Stats is referring to is that you can mark the answers you receive as "Correct" or "Helpful".  Those who provide answers look forward to getting that form of feedback.

Here's a quick and dirty way to examine a portion of a file, using SAS:

data _null_;

  infile 'path to file';

  input;

  if _n_ < 1000 then list;

  else stop;

run;

You can easily change the range of rows to examine, such as:

if (20050 <= _n_ <= 20923) then list;

else if _n_ > 20923 then stop;

Good luck.

Contributor
Posts: 68

Re: Text file

Thanks so much for letting me know about how to best provide feedback! I will do that first here now and then get back to your message. Smiley Happy

Contributor
Posts: 68

Re: Text file

I only see "reply" and "Liked" as available options, so used those. Do not see "correct" or "helpful." I will explore that/those later. Thanks again.

Super User
Posts: 19,038

Re: Text file

Go to the main discussion page, not the update/summary page to see those options.

SAS Employee
Posts: 232

Re: Text file

Hi lola, thanks for being part of this community - and Welcome!

Thank you all for wanting to mark answers correct/helpful.. and thank you to you all for helping lola. If you have any questions just let me know. Smiley Happy

Valued Guide
Posts: 2,177

Re: Text file

Iola

if you have base SAS (not Enterprise Guide and not SAS Studio) you can easily open that file with code

PROC FSLIST FILE= "your very large file" ;

RUN ;

Contributor
Posts: 68

Re: Text file

Yes, base sas. Thank you!

Contributor
Posts: 68

Re: Text file

Peter, so I tried:

PROC FSLIST FILE= "D:\Users\\xyz.txt" ;

RUN ;

The program continues to run for a very long time. The prgm to generate took an hour, so I let this run an hour and it says it is still running, but I can click and make changes in the program, so apparently not. Any detectable syntax issue? Or am I missing a no-brainer? Thank you.

Contributor
Posts: 68

Re: Text file

Update: these are a series of programs that can be run in two sequences. The next in one sequence actually uses that txt file data, thus my answer. Thank you!!!

Contributor
Posts: 68

Re: Text file

I should add that a separate window with the name FSLIST: D: pathname  does generate and a blank slate. Thank you.

Contributor
Posts: 68

Re: Text file

Astounding, this worked well. Thanks. It increased my confidence in the data, however I still would like to be able to open macro data file. Thanks so much.

Super User
Posts: 19,038

Re: Text file

lola wrote:

created a large (6.5m KB) text file, that is too large to open in notepad or word pad.

What is that, 6.5 MB? 6.5 GB? 

Try Notepad++, or use unix commands such as head to look at a few lines at a time.

You can also look into grep if you're looking for particular fields.

The best thing to do is actually run the process that would generate a test file and then run your big file once you're sure it's what you need.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 23 replies
  • 582 views
  • 17 likes
  • 9 in conversation