Solved

Header and Trailer on CSV

  • 28 January 2024
  • 1 reply
  • 37 views

Badge

I need to generate a CSV file with a header and trailer record, not column headers.  What is the best way to accomplish this?

icon

Best answer by James B 1 February 2024, 21:52

View original

1 reply

Userlevel 5
Badge

Do you have an example of the CSV file that you are trying to create? 

 

The CSV connector in CData Arc supports only simple CSV structures - the CSV can contain a header row or just data, but beyond the header row, all of the columns should be uniform throughout, since each row is a uniform line of data.

 

In the case where a single column in the CSV is used as a line type - say for instance a sample order like this:

 

HEAD,PO123,02/01/24,James Blasingame
LINE,1,Keyboard,19.99
LINE,2,Mouse,9.99
TOTL,29.98

 

Then the Flat File connector will do the job, when the connector is configured with a multiline character delimited format with a control field. 

 

Anything else can likely be achieved with a little bit of scripting or by using an XML Map with hardcoded header and footer outputs but the more custom the data structure, the more custom the solution you’ll need to use.

Reply