#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    Function cannot be parsed error in Sed


    Hi All,

    I have unix file which contains the description as shown below.
    the description conatins the \ i want to convert into \\ globally.

    Code:
    Any BATCH\ELORS|CONDENSED SOUP|CREAM OF TOMATO,|CHICKEN OR MUSHROOM|295G
    After conversion the output should be as show below.

    Code:
    Any BATCH\\ELORS|CONDENSED SOUP|CREAM OF TOMATO,|CHICKEN OR MUSHROOM|295G
    I have used the below command and i am getting error as below.

    Code:
    sed 's/\/\\/g' full_offers.ascii
    sed: Function s/\/\\/g cannot be parsed.
    Please help me on this ASAP.

    Thanks in Advance..

    Thanks
    Rags
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0
    I Have tried the below command its working fine.
    Code:
    sed 's/\\/\\\\/g' file_name.txt
    output:
    Code:
    Any BATCH\\ELORS|CONDENSED SOUP|CREAM OF TOMATO,|CHICKEN OR MUSHROOM|295G
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    854
    Rep Power
    387

    Cool


    Ooops, never mind.

IMN logo majestic logo threadwatch logo seochat tools logo