Computing.Net > Forums > Unix > Sed Help [/]

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sed Help [/]

Reply to Message Icon

Name: vmtrt
Date: March 9, 2005 at 11:56:26 Pacific
OS: HP UX
CPU/Ram: 256 ram
Comment:

Hi,
I am trying to update one of my files and am having trouble updating the date. In my file I have:
[a.aa]
$$start=08/01/2004
$$end=07/31/2005
[a.bb]
$$start=07/01/2004
$$end=06/30/2005

Based on aa or bb(within[])I have to update this file on start and end dates. I tried to use

sed "/$1/,/$/s/\$\$$2=.*$/\$\$$2=$3/1" infile
where 1=aa or bb, 2 = start or end 3 is the date to be passed.
Errors:
1)I am getting the parsing error if i use the date as mm/dd/yyyy, it works for mmddyyyy
2) I am able to change the value for $$end

Any help is greatly appreciated.
Thank you



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: March 10, 2005 at 04:48:22 Pacific
Reply:

Consider using a different delimeter character for sed.

sed -e "s,gre,p,"


0

Response Number 2
Name: vmtrt
Date: March 10, 2005 at 10:21:36 Pacific
Reply:

How do i change the delimiter character for sed


0

Response Number 3
Name: David Perry
Date: March 10, 2005 at 11:49:49 Pacific
Reply:

You can use any character you choose as per the example above. Choose one that does not appear in your string unless you will be escaping the delimeter character.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


AIX cleanup script Connection to Remote Serv...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Sed Help [/]

sed help with variable length file www.computing.net/answers/unix/sed-help-with-variable-length-file/5632.html

sed help www.computing.net/answers/unix/sed-help/6080.html

awk/sed help www.computing.net/answers/unix/awksed-help/6553.html