Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    143

    Unanswered: Remove last character from all lines

    Suppose I have a pipe delimited file called jam.dat which has

    aaa|bbb|ccc|ddd|
    eee|fff|ggg|hhh|
    iii||kkk|lll|
    mmm||||
    qqq|rrr|sss|ttt|


    I just needed to write a script that will erase the ending '|' symbol from each of the lines. How do I do this ?
    The end output should look like:

    aaa|bbb|ccc|ddd
    eee|fff|ggg|hhh
    iii||kkk|lll
    mmm|||
    qqq|rrr|sss|ttt

    Thanks

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    sed -e 's/\|$//g' jam.dat
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  3. #3
    Join Date
    Feb 2004
    Posts
    143
    Thanks, pal

Posting Permissions

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