BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rnmishra
Calcite | Level 5

I am working on a project where I need to create a sas data set from a messy text file. The issue is, I need to skip certain lines from the body of  text file. If I had to skip rows at the top 'firstobs' will take care of that and for skipping the rows at bottom 'obs' will help. How about skipping say 68th through 70th row and 100 through 110th row?

Any  help /suggestion would be highly appreciated.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

It depends a lot on the structure of the text file. Skipping specific lines could be as simple as

input var1 var2...;

if _n_ in (68:70, 100:110) then delete;

....

PG

PG

View solution in original post

3 REPLIES 3
Scott_Mitchell
Quartz | Level 8

Please provide a sample of the data you are working with so that we can help you.

PGStats
Opal | Level 21

It depends a lot on the structure of the text file. Skipping specific lines could be as simple as

input var1 var2...;

if _n_ in (68:70, 100:110) then delete;

....

PG

PG
rnmishra
Calcite | Level 5

Thanks PGStat. This is exactly what I want right now. However the 'Messy' text file that I have to handle right now has lot more issues. Will get back to you if my research fail to give a desired outcome.

Thanks again for the help!!!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 555 views
  • 0 likes
  • 3 in conversation