1

[ubuntu] using grep awk or any other unix tool to rearrange a file

view story
linux-howto

http://ubuntuforums.org – I have a file where I have a few lines like below: Quote: #S 1 some-test #D some-test #M some-test #X 10 Steps ( 20) #N 4 #L A B C 1 2 3 4 5 6 7 8 9 #R 17 11 12 #S 2 some-test #D some-test #M some-test #X 30 Steps ( 30) #N 4 #L A B C 1 2 3 4 5 6 7 8 9 #R 10 11 12 #S 3 some-test #D some-test #M some-test #X 30 Steps ( 30) #N 4 #L A B C 1 2 3 4 5 6 7 8 9 #R 10 11 12 #S 4 some-test #D some-test #M some-test #X 30 Steps ( 30) #N 4 #L A B C 1 2 3 4 5 6 7 8 9 #R 10 11 12 From the above file, for each section marked by " (Hardware)