Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    10

    Question Unanswered: Editing a file thro script

    Whats the best method to manipulate a text file through a script? A process would want to manipulate each single line of a file (identified by a unique value in the line) and change parts/entire content of the line.

    I've tried using vi with "heredoc" but thats very tiring. Any better way?

    Thanks to your suggestions.

    Rgds, Ram.

  2. #2
    Join Date
    May 2004
    Location
    Barcelona, Spain
    Posts
    54
    Quote Originally Posted by rkrishnan73
    Whats the best method to manipulate a text file through a script? A process would want to manipulate each single line of a file (identified by a unique value in the line) and change parts/entire content of the line.

    I've tried using vi with "heredoc" but thats very tiring. Any better way?

    Thanks to your suggestions.

    Rgds, Ram.
    Use awk. You can filter or change every line of the input file (which should be delimited). See then man page for details

    Regards,

    Iñaki

  3. #3
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    man ex with the here-doc

  4. #4
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    man ex with the here-doc

Posting Permissions

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