Unix/Linux Go Back    



Need to extract text repetitively between two patterns

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member Vignesh58 Regarding:
Need to extract text repetitively between two patterns.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 02-21-2013   -   Original Discussion by Vignesh58
Vignesh58 Vignesh58 is offline
Registered User
 
Join Date: Feb 2013
Last Activity: 21 February 2013, 8:16 AM EST
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Need to extract text repetitively between two patterns

Hi All,

I want to extract the text between some pattern which occurs repeatedly in a file. For example my input is like,

Code:
   [javac] [checking .....
   [javac] [checking .....
   [javac] [checking .....
   [javac] [checking .....
   [javac] /home/.....
             ..........java:25: cannot find symbol
    [javac] 
    [javac]............
    [javac] /home/......
    [javac] [loading java/lang/Math.class(java/lang:Math.class)]
    [javac] /home/.......
    [javac] [checking.......
    [javac] [checking.......
    [javac] [checking.......

I want to display text between "[javac] /home" upto "[javac] [" including these lines.

My output should look like..

Code:
    [javac] /home/.....
             ..........java:25: cannot find symbol
    [javac] 
    [javac]............
    [javac] /home/......
    [javac] [loading ...
    [javac] /home/.......
    [javac] [checking.......

Please help me to do that in shell script.