Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    usa
    Posts
    4

    Unanswered: sed: make new line

    for example i have:
    mond,tue,wed,thurs
    mond,tue,wed,thur,
    frd,sat,sun

    in a file, and i need to make a change so that the above become:
    mond
    tue
    wed
    thurs
    mond
    tue
    wed
    thur
    frd
    sat
    sun

    i used : sed -e 's/,/\\n/g' but that just replaces (,) with \n. please help.thanks all in advance.

  2. #2
    Join Date
    Sep 2003
    Location
    France, Nantes
    Posts
    8
    Try this (it's ok on AIX)


    cat file.txt |sed 's/,/ /g' |xargs -n1


    file.txt is your file

    I am not sure it is the better solution... but it's ok....

Posting Permissions

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