Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to split a file into header and details

I am working with a csv file that I would like to split into two tables of header and details. An Invoice would be a good example of this where there are multiple invoice headers and each invoice header has multiple line items. However, in the original source file the header information repeats for all of its lines.

 

Original File

  • Header_UniqueID
  • Header_SellerName
  • Header_BuyerName
  • Line_UniqueID
  • Line_Item
  • Line_QTY
  • Line_Price

 

Output

  • Header Table
    • Header_UniqueID
    • Header_SellerName
    • Header_BuyerName
  • Line Table
    • Line_UniqueID
    • Header_UniqueID (reference to record in the header table)
    • Line_Item
    • Line_QTY
    • Line_Price

I've searched the other forum posts, but not finding what I was looking for, but maybe im not using the correct working in my searches. I've also looked at the tNormalize/Demormalize components, but I dont think that is what I need either.

Labels (2)
1 Reply
TRF
Champion II

Use a tMap with 2 output flows, 1 for headers and 1 for lignes.
Connect 1rst output flow to a tUniqRow to eliminate duplicates, then to the desired output file or table.
Connect the 2nd output flow to the desired output file or table.