norm.flynn
New User
Joined: 08 Jan 2013 Posts: 20 Location: usa
|
|
|
|
I have a report file I am going to change into a CSV file
The report has 2 types of detail lines
Code: |
00999999 TESTT TEST , TEST 39-110 3-WARNING COMP TIME
RPTD HRS BLNC = 2.3
00999999 TEST, TEST R. 39-475 3-WARNING EIGHT OR LESS
00999924 TEST TEST, TEST 39-110 3-WARNING COMP TIME
RPTD HRS BLNC = |
.2
The first 9 bytes are either a numeric value or it is spaces and has the literal RPTD HDRS BLNC in col 55.
I would like to append the data from the RPTD line into the line above it in a cosolidated output record. Not all numeric details lines have the second line.
Using the data from above I would want output to look like
Code: |
00999999,TESTT TEST,TEST,39-110,3-WARNING,COMP TIME,RPTD HRS BLNC = 2.3
00999999,TEST,TEST R.,39-475,3-WARNING,EIGHT OR LESS
00999924,TEST TEST,TEST,39-110, 3-WARNING,COMP TIME, RPTD HRS BLNC = |
I just am looking for the technique to combine these 2 records when there are 2, and just put out the 1 record when it doesn't have that extra line, I know how to string the fields together using build etc.. All fields on the report are in a fixed column, i.e the id number is 1,9 and the literal RPTD starts in 55 and has blanks in 1-9
Thanks
Norm |
|