0
votes

From a website I receive contact data and booking information from customers in a csv file. This file has 18 fields. To keep overview of customers and bookings I use a 3rd party software where I can import data from a csv in a specific field order and with more fields.

I need a tool / automated process to change my emaild csv in the following way:
import file : export file
field1 : field3
field2 : field6
field3 : field4
field4 : field18
field5 : field9
(these are example values)

1

1 Answers

0
votes

This would be easy in awk if I could understand what you actually want. It might be the following:

awk '{print $3,$6,$4,$18,$9}' yourfile

which will print the third, sixth, fourth etc. fields of yourfile. If your fields are separated by commas, rather than whitespace, add -F to specify the field separator like this

awk -F, '{ ... as above ...}' yourfile