Merge 3 table values into one flat file
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a workflow that produces 3 output values, Header row, Detail rows and Trailer row. I would like to merge them so I can output into a single flat file. Now sure how can I achieve this
here's my workflow
Here's are the 3 table values I needed them to be merged into a single Flat file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @nshah48
This is not a direct answer with your data, but you can see how it works and adapt to your case.
1)First, you need to know the length that each field need to have. For example, you can have the a column with name project and first cell with the data project2 (8 characters), but lets assume that the length of this field inside of the flat file according with the specifications need to be 70. So you would need to add a lot of space characters to the right of it.
This can be achieved with the padright function (for numbers, it is usually padleft and filling with 0). This tricky needs to be applied to each column individually:
2)After having each field with the specified length, you gonna concatenate it all:
3-The above steps need to be done for Header/Detail and Trailer separately. Each one will have its own specification and data. After doing it, you will union it all to make 1 file:
And in the end, you will save it as a flat file.
The flat file is basically a text file. ofc i used some dummy data that does not even make sense, so it is not looking good as the result that i have with real data.
With this overall idea, the attached example (dummy data) and some work, i believe that you gonna be able to do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks, Felipe_Ribeir0 I used your idea and merged each record (Header, Body and Trailer) into one field with a record length of 82 and then union them together and tried exporting to a flat file and it worked/
