vodkadrinker
Technical User
I have a file which has a similar structure to the following test.file
AAAAA1*******
AA2;;;;;;;;;;;;
BBBB1*******
BBBBBBBBBB2;;;;;;;;
I have used the following script to list 1 line per record so in this case each record has 2 fields.
for i in `pr -2 -t -a -s" " /test.file|awk '{print $1","$2}'`
do
echo $i
done
and the result is...
AAAAA1*******,AA2;;;;;;;;;;;;
BBBB1*******,BBBBBBBBBB2;;;;;;;;
Is there a better way to do this and how can I trim all the "*" and the ";" from the output.
AAAAA1*******
AA2;;;;;;;;;;;;
BBBB1*******
BBBBBBBBBB2;;;;;;;;
I have used the following script to list 1 line per record so in this case each record has 2 fields.
for i in `pr -2 -t -a -s" " /test.file|awk '{print $1","$2}'`
do
echo $i
done
and the result is...
AAAAA1*******,AA2;;;;;;;;;;;;
BBBB1*******,BBBBBBBBBB2;;;;;;;;
Is there a better way to do this and how can I trim all the "*" and the ";" from the output.