in reply to Extracting each line in a file to new file seperately

Read up on linux split command. This may be the easiest!
  • Comment on Re: Extracting each line in a file to new file seperately

Replies are listed 'Best First'.
Re^2: Extracting each line in a file to new file seperately
by raj17 (Initiate) on Feb 10, 2012 at 16:23 UTC

    ok so i have to do use split command:
    split -l 300 newfile.txt with looping k thank you for ur valuble suggestion

      Except that that will split your file into files with 300 lines each. If you want one line each, you'll need to use `split -l 1 file.orig new.`. Also, by default, split will use two-character lowercase alpha suffixes (aa .. zz) to name the new files, so it'll run out if you split into more than 676 chunks. Check the split man page for how to increase that.

      Aaron B.
      My Woefully Neglected Blog, where I occasionally mention Perl.