Link to home
Start Free TrialLog in
Avatar of bje
bjeFlag for United States of America

asked on

replace value with another value that has a space in the value

Working on replacing a value with another value that has a space in it.   the values are comma separated, so i am using the comma as part of the string that i am looking for

sed s -e '/\,value1,/\,value2 value2,/g' filename > newfilename

the second value has a space in it


Thanks in advance for the help
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bje

ASKER

thanks for correcting my syntax.

Another sed question, having trouble combining two sed commands into one

sed -e 's/\-/\/g' -e 's/\&/\/g' filename > newfilename

this will not remove both values.

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bje

ASKER

Thank you