Pulling a flat file into format for PH

Mike Godsey mgo at columbus.rr.com
Mon Aug 29 18:04:55 CDT 2011


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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20110829/cc0d591d/attachment.htm 


More information about the powerh-l mailing list