Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I need help for making an awk script. I'm reading how it works, but in the meantime I try to ask you for an help. If you tell me ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    1

    Need help for AWK script


    Hello, I need help for making an awk script. I'm reading how it works, but in the meantime I try to ask you for an help.
    If you tell me to read the documentation.. I know.. you're right.
    By the way, here is some input

    Code:
     START1102020202020202020202020
     124934093209090934030493090900
     130942'3492'409240923'43294904
     14453'590934'503495'3094'54395
     END11910293'2931912'391309'23'
     START0002020202020202020202020
     124934093209090934030493090900
     130942'3492'409240923'43294904
     14453'590934'503495'3094'54395
     END00910293'2931912'391309'23' 
     START1102020202020202020202020
     124934093209090934030493090900
     130942'3492'409240923'43294904
     14453'590934'503495'3094'54395
     END11910293'2931912'391309'23'
    My awk program has to work in this way:

    until the end of the document
    if the beginning of the line is "START11"
    while the beginning of the line is different form "END11" print the whole line (print the "END11" line too)

    Could you help me or give me some hints?
    Thanks.

  2. #2
    Linux Newbie radoulov's Avatar
    Join Date
    Sep 2007
    Posts
    111
    Code:
    awk '/^START11/,/^END11/' infile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •