We have a requirement to format data, given in list format, into a CSV file
Example input:
ORG MANAGER
No ORG MANAGER found
BILLING MANAGER
No BILLING MANAGER found
ORG AUDITOR
xxx
yyy
zzz
aaa
bbb
ccc
Example output:
ORG MANAGER BILLING MANAGER ORG AUDITOR
No ORG MANAGER found No BILLING MANAGER found xxx
yyy
zzz
aaa
bbb
ccc
I did split the every paragraph and kept it in separate files and tried printing them using paste -d '\t\t command like below:
paste -d "\t\t\t" file1 file2 file3 > fin.csv
After this I tried formatting the output using below command:
awk '{ $NF = "\t" $NF; print }' fin.csv | column -t -s $'\t'
But the output is not like what I have expected.
paste -d "\t\t\t" file1 file2 file3 > fin.csv --> to print the files side by side
awk '{ $NF = "\t" $NF; print }' fin.csv | column -t -s $'\t' --> to format
Expecting to print every paragraph in separate columns such that I can keep them in Excel to format.
I am adding the expected input and output format in the attached snap for the clear understanding.