|
jsl,
I would make it a two step process, one to fix the file and one t read the
fixed file. This works with the data given. You may need to change lengths
when more data is considered. If one logical record is more than two lines
then the first step will need more changes.
filename temp temp ;
data _null_ ;
length line $ 200 ;
retain line ;
infile cards firstobs = 2 ;
input ;
file temp ;
if substr(_infile_,1,2) ^= " " then
do ;
line = trim(line) || _infile_ ;
put line ;
end ;
else
do ;
if _n_ > 1 then put line ;
line = left(_infile_) ;
end ;
cards ;
..........
;
data w ;
infile temp dsd dlm = "/" ;
input name :$30. age :5. title :$70. remuneration :$20. ;
run ;
IanWhitlock@westat.com
-----Original Message-----
From: jsl [mailto:nospam@NOSPAM.COM]
Sent: Friday, September 12, 2003 2:44 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Data with Carriage return where I don't want it.
I have a very large "text file" data set that has a bunch of pockets of
information that looks like the attached text file. I have been able to
read it just fine for the most part keying off words in the first line, but
I can't figure out the easiest way to deal with the unwanted hard return.
That is, given the source of the data, I have no control over the unwanted
carriage return within a record. However, I do know that the first two
columns are always blank unless it's a record that wrapped. Anybody have
simple suggestion on how to keep those lines together? Thanks, Jim
|