Pulling a flat file into format for PH
Richard Witkopp
RWitkopp at phxa.com
Tue Aug 30 15:59:21 CDT 2011
Did you try using Excel like I suggested before?
Start Excel, Data, Import External Data, pick your .csv file. Tell it the file is delimited, comma delimiter, finish.
Then File, Save As, choose a .prn type. You should get:
FE3-150EA-01B SORT1 186 136 127
MXO1200C-01D SORT3 212020912067
FXP2-8E-01C SORT1 247424022392
FE3-95E-01B SORT1 426 293 341
FXP2-5E-01D SORT1 350234623419
FTP the .prn file to your Powerhouse system and create a subfile to
match the record. Copy the .prn file on top of the .sf file.
________________________________
From: powerh-l-bounces+rwitkopp=phxa.com at lists.sowder.com [mailto:powerh-l-bounces+rwitkopp=phxa.com at lists.sowder.com] On Behalf Of Karen Barrett
Sent: Monday, August 29, 2011 4:38 PM
To: mgo at columbus.rr.com; PowerhouseList Post
Subject: RE: Pulling a flat file into format for PH
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,127
MXO1200C-01D ,SORT3,2120,2091,2067
FXP2-8E-01C ,SORT1,2474,2402,2392
FE3-95E-01B ,SORT1,426,293,341
FXP2-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 Barrett
Elk Point, SD
360 608-6243
------------------------------------------------------------------------------
NOTICE: The information contained in this e-mail and any attachments is confidential and may be privileged or otherwise protected from disclosure.This e-mail is intended solely for the use of the named addressee. Any other use, printing, copying, disclosure or dissemination may be subject to legal restriction. If you are not the intended recipient, please contact the sender and delete all copies including any attachments.
==============================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20110830/0cfe4316/attachment-0001.htm
More information about the powerh-l
mailing list