FlowHeater - The Data Import / Export Specialist
See also the existing examples of using the TextFile Adapter , which may answer your question: text file codepage converting 1 / 2 , processing of CSV header and footer rows , Import/Export vCard (line based) text files

Import .csv … Header/Details from separate lines

  • JD Cox
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
11 years 3 months ago #2162 by JD Cox
We have a new customer that sends us a file with an H or D in the first column of a .csv file. H(Header) D(Details) we’re use to files that contain details on each line with the order (H) information repeated on the details. I import these file into a temporary access table then run some import queries to get the data to the correct place. The problem I’m having is creating a definition to import all of the detail information and add the header information to those details. The order number is on every line. I am not well versed with the net script but I’m trying to learn.

This is what I get in the csv file:

Type Number ShipTo/QTY Address/Item
H AB456 John Smith 123 Any St
D AB456 1 57X452
D AB456 1 78Y897
H DB678 Jane Smith 456 Road
D DB678 4 89G654

This is what I need to create:

Number ShipTo Address QTY Item
AB456 John Smith 123 Any St 1 57X452
AB456 John Smith 123 Any St 1 78Y897
DB678 Jane Smith 456 Road 4 89G654

Thanks in advance for any help offered.

Please Log in or Create an account to join the conversation.

11 years 3 months ago #2163 by FlowHeater-Team
Replied by FlowHeater-Team on topic Re:Import .csv … Header/Details from separate lines
Hi JD,

Thanks for this challenge :-)

With the current version 2.1.0 this is very tricky! Soon a new version 2.1.1 is available. In this version you can store parameters/values and use it in other heaters or function.

With this new feature and a short .NET script this is very easy.

I’ve made a little example to explain how it works. Please have a look to the attachment.

Note: Please download first the beta version of FlowHeater here . This example works only with version 2.1.1 (coming soon) and later or with the beta version!

How works this example?
  1. We have to configure the TextFile Adapter on the READ side to read just hole whole lines
  2. Then we need a .NET Script Heater to decide what type of line we have (H = HEADER or D = Detail). If we have a header line the script store this line into a parameter value for later use and tell the Filter Heater to filter this line/row.
  3. The SubString Heater gets the detail information for each field on the WRITE side.
  4. The Get Parameter Heater gets the last stored header line from the script. The SubString Heater extracts the "ShipTo Address" for each detail line.

Attachment extract_and_ignore_csv_header_lines.zip not found

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

Please Log in or Create an account to join the conversation.

  • JD Cox
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
11 years 3 months ago #2167 by JD Cox

Thanks for your reply. Sorry I have not responded but I’ve been very busy and traveling.

At first glance it does ignore the header rows. But, I need it to also put the header row information in where the ID numbers are equal. I have a few acceptable ways of dealing with this for now while the volume is low. However, we’re looking for an increase in about six months. I just downloaded version 2.2.1. I see a few new heaters I must look at. I’ll let you know how it goes.

Thanks again for all your help. JD

Please Log in or Create an account to join the conversation.

Time to create page: 0.363 seconds

other Languages


FlowHeater Home

de en


Privacy Statement

Copyright © 2009-2023 by FlowHeater GmbH.
All rights reserved.

Follow us on

twitter  facebook


 de en