LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 12 Sep 2003 10:44:53 +0200
Reply-To:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:   Re: Read in bad text file
Comments:   To: PD <sophe88@YAHOO.COM>
Content-Type:   text/plain; charset="iso-8859-1"

Hi PD,

Dedicated solutions (in or outside SAS) may be developed. I developed a general purpose data manipulation program, which is easily able to convert your example to: ---------converted-example--------- paula d address 1 new york ny 12345 Jason D address 1 boston MA 01234 Laura D address1 Chicago IL 60092 john d address1 ---------end-of-example--------- Note the remaining spaces before Jason.

If you think this is sufficient and want to apply this method, then download DATAFIX in http://home.hccnet.nl/jim.groeneveld/software/data/datfx231.zip unpack the ZIP files and issue the DOS command: datafix bad-text.in /X f=.\n c=\n\t /l | datafix T=bad-text.out /X f=\t c=\n where bad-text.in is your data file and bad-text.out is the resulting data file.

Good luck - Jim.

Y. (Jim) Groeneveld MSc Biostatistician Vitatron B.V. Meander 1051 6825 MJ Arnhem The Netherlands +31/0 26 376 7365; fax 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

-----Original Message----- From: PD [mailto:sophe88@YAHOO.COM] Sent: Friday, September 12, 2003 04:39 To: SAS-L@LISTSERV.UGA.EDU Subject: Read in bad text file

I have a fixed length text file that is bad. Each record stats with a person's name, but returns to next line or the 3rd to end, before next names comes in line. Example is

paula d address 1 new york ny 12345 ....................... .................. Jason D address 1 boston MA 01234 .... .........Laura D address1 Chicago IL 60092................. .............................................john d address1 ...............

Is that anyway to read it so they will line up like

paula D address 1 jason d address 1 Laura d address 1 john d address 1

Thanks.

PD


Back to: Top of message | Previous page | Main SAS-L page