Re. formatting, have a read of the link shmem gave you and just have a play around to see what works, trying things out on your private scratchpad which you can find on your home node. <p> and <code> ... </code> tags are your friends.
So, further questions. Do you want to capture the possible name on line 3 or will you always use the one on line 4? Are the a/c nos. on lines 8 and 11 the same and do you want to capture just one of them? Are the dates ddMMMyyyy or dd MMM yyyy? It looks like the latter. Is information on line 18 significant or is it just a marker with the meat starting on line 19 et seq.? How many output fields, what order, what widths and what pad character? What is your policy on truncating data that is too wide?
I think that given answers to the above I can (without writing your whole application for you :-) make some suggestions and code pointers on how you can proceed.
Cheers, JohnGG | [reply] |
Advice and suggestions are greatly appreciated. I am a complete newb when it comes to PERL. I will need to capture line 3 if it appears and line 4 always since there will always be a name there. The a/c #'s are supposed to be the same number and have been only represented once in the past so a capture of either is fine. The dates are dd MMM yyyy format yes. Line 18 is the starter of the detail and needs to be included in the first line on the details file. Pad character needs to be a space, there should be no truncating of data but if the data that populates the specific field is longer than the specified width it would truncate certainly ( has not been an issue before). I am going to give the format for the header file now so bear with me. Starting at character 0( is the account number line 8 or 11 and field 1), starting character 18 is field 2(40 characters) static text, character 58 is field 3(40 characters) static text, starting character 98 is field 4(40 characters) static text, starting character 138 is field 5(40 characters) static text, starting character 178 is field 6(40 characters) is line 3 if data exists or line 4 if it does not exist, starting character 218 is field 7(40 characters) and is line 5, starting character 258 is field 8(40 characters) and is line 7, starting character 298 is field 9(40 characters) static text, starting character 338 is field 10(40 characters) static text, starting character 378 is field 11(7 characters which is the first date value on line 12 and needs to be formated to ddmmmyy), starting character 385 is field 12(7 characters, the second date on line 12 and needs to be format ddmmmyy), starting character 392 is field 13(10 characters)static text, starting character 402 is field 14(10 characters) static text, starting character 412 is field 15(40 characters) this is line 4 if line 3 has data and results to blanks if no data on line 3, starting character 452(8 characters) this is the starting line count for the matching detail file, starting character 460(6 characters) this is the count of detail lines outputted to the detail file( used to compute the prior value obviously). If this is unclear, do you have a way I could send you the lay out file and what not so you could see more clearly how it is laid out?
| [reply] |
Not quite done with questions it seems.
Fields 2 - 5, 9, 10, 13 and 14 don't appear to have any data associated with them, should they be space-filled?
In this node you say that city/state/ZIP need to be split out but here the whole of line 7 goes into field 11 (offset 378). What gives?
Your fields at offsets 452 and 460 seem to mandate one header file and one detail file as output rather than separate detail files for each customer. Is the starting line offset into the detail file zero-based? Cheers, JohnGG
| [reply] |