BookmarkSubscribeRSS Feed
fengyuwuzu
Pyrite | Level 9

I have one CSV file, and there are 4 blank rows in the CSV file.

when I used proc import, the blank rows were imported as blank rows, too. Is there a way to not to import the blank rows?

 

A similar situation is, in my another CSV file, at the end of the data rows, there are several blank rows with one line in middle containing some summry words, like below:

 

7e30e5e5590d9772d1e743c66eadc09f3e7a3ac0 197612 NULL 19131 PA 55:30.1 23:54.4
bdf42c335be105c0e0b6a968ea150730e1cca316 197804 NULL 19015 PA 25:15.6 23:54.4
             
(28808 row(s) affected)        
             
             
1 REPLY 1
LinusH
Tourmaline | Level 20

PROC IMPORT is a standard easy to use utility, which in turn gives you not that much detailed control.

So you choices are to use the data step to import your data, or post process your input data in a succeeding data step/SQL.

 

The same goes with your next example, you need some logic to rule out the summary row as well.

You could use that summary row for validation purposes as well, if like/feel need to.

Data never sleeps

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 3013 views
  • 0 likes
  • 2 in conversation