I am trying to get the slot address and volume tag and put them in separate columns. Below are the commands that I'm trying to use in order to accomplish this.
cat file | egrep 'Slot Address|Volume Tag' > test.out
cat test.out | awk '{print $3,$4}'| sed 's/.....................//g' | awk 'BEGIN{FS="\n";OFS="\t";}{print $1,$2}'
Sample output from the file:
Slot Address 4110
Volume Tag ..................... HN5037L1
Slot Address 4111
Volume Tag ..................... B00006L1
Slot Address 4112
Volume Tag .....................
I want the final output to appear as follows:
Slot Volume
====================
4110 HN5037
4111 B00006
How should I go about doing this?
Thanks,
John
cat file | egrep 'Slot Address|Volume Tag' > test.out
cat test.out | awk '{print $3,$4}'| sed 's/.....................//g' | awk 'BEGIN{FS="\n";OFS="\t";}{print $1,$2}'
Sample output from the file:
Slot Address 4110
Volume Tag ..................... HN5037L1
Slot Address 4111
Volume Tag ..................... B00006L1
Slot Address 4112
Volume Tag .....................
I want the final output to appear as follows:
Slot Volume
====================
4110 HN5037
4111 B00006
How should I go about doing this?
Thanks,
John