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 (May 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 10 May 2006 10:06:07 -0400
Reply-To:   Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Subject:   Re: Reading CSV Problem
Comments:   To: rdbisch@GMAIL.COM

Hi Rick,

Instead of using your usual INPUT statement you could use an empty INPUT statement, implicitly filling your _INFILE_ variable. You have to analyze the contents of that variable yourself into the other variables. But with your 5th variable you could search for the ending double quote, while reading subsequent records (INPUT;) and append the contents to that 5th one.

Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld

On Wed, 10 May 2006 06:04:09 -0700, Rick <rdbisch@GMAIL.COM> wrote:

>Hello all. I have a slight problem reading a comma seperated file with >a long text field. Basically the problem record looks like this: > >1,2,3,4,"This is a sample text that illustrates my problem. > >I hit enter a few times here.Blah blah blah", "shorter text", "small", >"Y", 4 > >**end record > >The first four variables are stored OK. The fifth variable has the >value "This is a sample text that illustrates my problem.". The sixth >has the value "I hit enter a few times here.Blah blah blah", when it >should have the value "shorter text". > >Is there a way to get SAS to read in that entire text into a single >variable? Right now my infile statement is: > >"infile sample.txt dsd lrecl=8192"


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