Pulling a flat file into format for PH
Karen Barrett
kbarrett00 at hotmail.com
Mon Aug 29 18:37:45 CDT 2011
Thank you Mike,
I remembered this part, it is the getting it into "REC_80" I am struggling with. Do I build a subfile that is 80 chars wide? Is there something I need to do to the csv besides copy it on top of the .sf?
FE3-150EA-01B ,SORT1,186,136,127MXO1200C-01D ,SORT3,2120,2091,2067FXP2-8E-01C ,SORT1,2474,2402,2392FE3-95E-01B ,SORT1,426,293,341FXP2-5E-01D ,SORT1,3502,3462,3419
Karen
From: mgo at columbus.rr.com
To: kbarrett00 at hotmail.com; powerh-l at lists.sowder.com
Subject: RE: Pulling a flat file into format for PH
Date: Mon, 29 Aug 2011 19:04:55 -0400
Karen,Your process will work as long as all of the fields are exactly the same length. However, if they vary then you need something like this. ;Quiz sample code DEFINE COMMA1 INT*2 = INDEX(REC_80, ',') DEFINE COMMA2 INT*2 = COMMA1 + INDEX(REC_80[COMMA1 + 1:80 - COMMA1], ',') DEFINE COMMA3 INT*2 = COMMA2 + INDEX(REC_80[COMMA2 + 1:80 - COMMA2], ',') DEFINE COMMA4 INT*2 = COMMA3 + INDEX(REC_80[COMMA3 + 1:80 - COMMA3], ',') DEFINE POLICY CHAR*12 = REC_80[COMMA1 - 12:12] DEFINE EXAMINER CHAR*8 = REC_80[COMMA1 + 1:COMMA2 - COMMA1 - 1] DEFINE RATE CHAR*8 = REC_80[COMMA2 + 1:COMMA3 - COMMA2 - 1] DEFINE ACCT-EXEC CHAR*8 = REC_80[COMMA3 + 1:COMMA4 - COMMA3 - 1] Mike From: powerh-l-bounces+mgo=columbus.rr.com at lists.sowder.com [mailto:powerh-l-bounces+mgo=columbus.rr.com at lists.sowder.com] On Behalf Of Karen Barrett
Sent: Monday, August 29, 2011 18:22
To: PowerhouseList Post
Subject: Pulling a flat file into format for PH
Hi All, I used to know how to do this but too many years since last time. Users want to send me a delimited file to use for updating tables. I seem to recall that I made a subfile with a defined line (just one big one) and then copied the csv on top of the .sf. After that I could parse out the fields using index to locate the delimiters. I'm not getting a fixed length line so this is not working. Ideas? Thanks in advance! Karen BarrettElk Point, SD360 608-6243
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20110829/ca96a15e/attachment-0001.htm
More information about the powerh-l
mailing list