0

Can any one help me how can we pass input with multiple lines to CSV node which has different columns/elements for each line.

I have a text file with below content

H|1|2|3|$|4|4
D|3|4|5
D|4|4|6
D|2|3|4

Here,how can we pass columns names for H-header,D-details differently to CSV node which generated JSON.

Thanks in advance!!

clay
  • 25
  • 4

1 Answers1

1

The best you can do is to use a switch node to split lines based on the first character and then run those lines through 2 separate CSV nodes.

enter image description here

The 2 CSV node can contain the header names for different line types.

The switch node should be configured something like this:

enter image description here

You can then combine the 2 legs of the flow again to consume the different messages for the output of the CSV nodes.

hardillb
  • 54,545
  • 11
  • 67
  • 105