in reply to Coping a part of text file

Please help us help you:


Dave

Replies are listed 'Best First'.
Re^2: Coping a part of text file
by Anonymous Monk on Jul 04, 2013 at 08:11 UTC
    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

      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

      Where's the code?

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


      Dave