generate new string from a text file
Hi,
I have a file and the content looks like this: line1 line2 File #5 : found '/u01/testing.txt' line5 line6 line7 File #12 : found '/u01/testabc.txt' line10 line11 I want to write a bash script to give me the output: The file 5 is '/u01/testing.txt' The file 12 is '/u01/testabc.txt' As I am new in shell script, can anyone tell me how to do this? Thanks!! Walter |
This will do it:
Code:
grep -A1 " : found" theFile | grep -v -- "--" | paste - - |
Code:
$ cat myfile |
All times are GMT -5. The time now is 05:35 PM. |