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 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 24 May 2001 15:00:14 GMT
Reply-To:     porsche_nut@MY-DEJA.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         porsche_nut@MY-DEJA.COM
Organization: NewsOne.Net - Free Usenet News via the Web - http://newsone.net/
Subject:      SUMMARY:Split variable using regular expression

I received several interesting suggestions to the problem I had posed below, including a couple that were posted. The solutions were in general of the following nature.

1. Use perl to identify the files that are to be read in sas via a pipe (and thus use split to do what I needed)

2. Iteratively search the string to be "split" for various delimiters using the index function and then substring.

3. Use scan.

1. seemed certainly workable but is ruled out in my case as I had to stick to SAS. 2 seemed to be a lot of work, but would ensure that I got exactly what I needed. 3. worked just fine with a bit of modification (some pretreatment of the string to control for multiple delimiters).

Thanks all.

Hunan.

In article <9ebp1r$upi$1@news.netmar.com>, <porsche_nut@my-deja.com> writes: >Does anyone know of a way to replicate the functionality of the 'split' >function in perl? > >My problem (sasv8 on UNIX). > >I am reading in a list of files (traversing a directory tree using find) into >a dataset and using the FILEVAR option to open a bunch of other files. No >problems so far. I need to be able to parse values in the FILEVAR variable to >extract some features--simple substring based extracts don't work. I did look >at the RX functions, but couldn't get too far as they seem to be limited to >matches and substring operations. > >Perl split does the trick but then I would have to cat the files outside SAS >and then read them in which is wasteful. Any thoughts? > >Hunan. > > ----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web ----- > http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups > NewsOne.Net prohibits users from posting spam. If this or other posts >made through NewsOne.Net violate posting guidelines, email abuse@newsone.net

----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web ----- http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups NewsOne.Net prohibits users from posting spam. If this or other posts made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


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