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
Name: gera Date: September 5, 2006 at 16:18:35 Pacific OS: XP CPU/Ram: P4
Comment:
I need to comment out one line from myfile
My file: foo.txt
test_resume_one pass_resume_two fail_resume_three
I want to put # at the start of pass_resume_two so that my foo.txt look
Name: don2006 Date: September 5, 2006 at 16:34:52 Pacific
Reply:
What's wrong with using vi?
0
Response Number 2
Name: gera Date: September 5, 2006 at 17:52:56 Pacific
Reply:
Nothing is wrong with using VI . I have "pass_resume_two" at the start of a line in multiple lines inside foot.txt. That is why I am trying to use sed.
0
Response Number 3
Name: nails Date: September 5, 2006 at 20:02:30 Pacific
Reply:
sed 's/^pass_resume_two/#pass_resume_two/g' data.file
0
Response Number 4
Name: nails Date: September 5, 2006 at 20:43:14 Pacific
Reply:
Come to think of it, you can still use vi:
vi data.file <<MSG :g/^pass_resume_two/s//#pass_resume_two/g :wq MSG
0
Response Number 5
Name: lchi2000g Date: September 13, 2006 at 18:59:01 Pacific
Reply:
Based on nails solutions:
1. sed 's/^pass_resume_two/#&/g' data.file
2. vi data.file <<MSG > /dev/null 2>&1 :g/^pass_resume_two/s//#&/g :wq MSG
Luke Chi
0
Response Number 6
Name: lchi2000g Date: September 13, 2006 at 19:03:12 Pacific
Reply:
3. vi data.file <<MSG > /dev/null 2>&1 :1,\$s/^pass_resume_two/#&/g :wq MSG
Summary: 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 a...
Summary: I have the sed commands but need help stringing them together correctly. Reading a variable length file where the last line is only ^Z. Need to change the preceding line ending in ^M to ^M^Z. ...
Summary: I'm trying to sed a character out of a series of files. The character is the euro symbol in Windows, 128 on the character map I believe. In vi it's showing up as ^À. I've tried running: sed "s/^À//" f...