I have a need to create a fixed length flat file with a requirement for different lines to have different lengths, e.g. the Header row is length 100 and the detail row is length 150. The output tool always writes a file with all lines the same length, the longest length.
Does anyone know a way to solve this problem?
Solved! Go to Solution.
If you read your flat file in as a csv with \0 as the delimiter maybe you can trim the first record and create a csv with \0 as a delimiter.
I'm not reading a file. I'm trying to write to a file
It looks like that will work
I have a similar need, to export data in a fixed field .txt format with specified lengths for each column:
Field_Name | Length | Field_Type |
FIRST NAME | 32 | CHARACTER |
MIDDLE NAME | 32 | CHARACTER |
LAST NAME | 32 | CHARACTER |
ADDRESS LINE 1 | 38 | CHARACTER |
ADDRESS LINE 2 | 28 | CHARACTER |
CITY | 15 | CHARACTER |
STATE | 2 | CHARACTER |
ZIP CODE | 9 | CHARACTER |
SSN | 9 | CHARACTER |
DOB | 10 | CHARACTER |
Subcode | 8 | CHARACTER |
Unique_ID | 8 | CHARACTER |
Portfolio_ID | 2 | CHARACTER |
What's the best way to accomplish this?
I tried everything and thankfully found your response.
Worked like a charm! Thanks for sharing @MarqueeCrew
It indeed does! 💪