Closed slackmoehrle closed 2 years ago
I have data:
07/01/2022, 10:00, 1.00, 2.00, 1.00, 2.00, 5000 07/01/2022, 10:01, 1.25, 2.00, 0.99, 2.00, 3000
and I want to end up with:
07/01/2022 10:00, 07/01/2022, 10:00, 1.00, 2.00, 1.00, 2.00, 5000 07/01/2022 10:01, 07/01/2022, 10:01, 1.25, 2.00, 0.99, 2.00, 3000
which is concatenating fields 1 and 2 and then outputting all data to a csv.
How can this be done?
In awk I could do something like this: awk -F',' 'NF {print $1"-"$2","$0}'
awk
awk -F',' 'NF {print $1"-"$2","$0}'
We don't have that option but maybe https://github.com/jqnatividad/qsv or https://github.com/BurntSushi/xsv can do it.
I have data:
07/01/2022, 10:00, 1.00, 2.00, 1.00, 2.00, 5000 07/01/2022, 10:01, 1.25, 2.00, 0.99, 2.00, 3000
and I want to end up with:
07/01/2022 10:00, 07/01/2022, 10:00, 1.00, 2.00, 1.00, 2.00, 5000 07/01/2022 10:01, 07/01/2022, 10:01, 1.25, 2.00, 0.99, 2.00, 3000
which is concatenating fields 1 and 2 and then outputting all data to a csv.
How can this be done?
In
awk
I could do something like this:awk -F',' 'NF {print $1"-"$2","$0}'