I have a list of files that should contain the following
I have found many that do not have some of this content. Could be missing any one or any number of entrys shown above.
The code above will in example provide problem output - columns arent lined up
what I after is
This way, when I move it into the Microsoft environment the colums will be aligned correctly.
Thanks in advance
35001
35002
35003
35004
35005
35006
I have found many that do not have some of this content. Could be missing any one or any number of entrys shown above.
Code:
cat *.txt | while read file
do
grep 3500[1-6] file | tr '\012' ','
done
The code above will in example provide problem output - columns arent lined up
one.txt 35001,35002,35005,35006
two.txt 35002,35003,35004,35005,35006
three.txt 35001,35002, 35003,35004,35005,35006
four.txt 35001,35006
what I after is
one.txt 35001,35002,,,35005,35006
two.txt ,35002,35003,35004,35005,35006
three.txt 35001,35002, 35003,35004,35005,35006
four.txt 35001,,,,,35006
This way, when I move it into the Microsoft environment the colums will be aligned correctly.
Thanks in advance