in reply to Re: Coping a part of text file
in thread Coping a part of text file

My file looks something like this
FILENAME: tes.txt FileName: + Function: + Written by: + + REVISION -Rev. -- Date -------------------------------------------------- 00 11/11/11 Initial release. 01 12/04/12 Edited 01 12/04/12 Final 02 01/10/13 Sispatched ----------------------------------------------------------------*/ DATA LIST /*========= List =========*/ Currency ............. cotd

the output I desire is this

FILENAME: tes.txt FileName: + Function: + Written by: + + REVISION -Rev. -- Date -------------------------------------------------- 00 11/11/11 Initial release. 01 12/04/12 Edited 01 12/04/12 Final 02 01/10/13 Sispatched ----------------------------------------------------------------*/ DATA LIST

what I am getting is all the words in a same line

Replies are listed 'Best First'.
Re^3: Coping a part of text file
by hippo (Archbishop) on Jul 04, 2013 at 08:21 UTC
    perl -pe '/========= List =========/ and exit;' infile > outfile

    ... or is the requirement more complex than specified?

      Hey just one more help required , if I have an array and I need to find a specific word in it like DATA LIST , by avoiding any space that may be present before DATA or after LIST , how can I do it

        With grep, I imagine.

        Hey just one more help required

        You are Columbo, AICMFP.

Re^3: Coping a part of text file
by davido (Cardinal) on Jul 04, 2013 at 08:16 UTC

    Where's the code?

    Update: Nevermind, I see you've posted it in response to another follow-up in this thread.


    Dave