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.
Creating a sed file
Name: nmf Date: February 7, 2004 at 16:25:31 Pacific OS: unix/osx CPU/Ram: mac G3 256 Ram
Comment:
I'm using the -f for the first time. I'd like to use it for multiple replaces to clean a file up.
This is the command line
sed -f clean.sed test > test.1
this is the sample clean.sed file { s/","/" "/g; s/"."/" "/g; }
The resulting test.1 file has no changes. What are the requirements for the sed file. Thanks
Name: Dlonra Date: February 8, 2004 at 08:02:01 Pacific
Reply:
works for me - thanks for the sed lesson whats in the file?
0
Response Number 2
Name: Jim Boothe Date: February 9, 2004 at 07:47:56 Pacific
Reply:
The slashes delimit the string you want to find, so you don't want those double-quotes. The search string /"."/ is searching for a double-quote followed by any single character followed by another double-quote. The dot is a standard regexp wild character, so you need to precede it with a backslash for it to represent an actual dot. What you want is:
{ s/,/ /g s/\./ /g }
0
Response Number 3
Name: nmf Date: February 9, 2004 at 12:32:11 Pacific
Reply:
Many thanks, it worked. I also noted that you removed the ; at the end of each line.
Natalie
0
Response Number 4
Name: Jim Boothe Date: February 10, 2004 at 10:29:24 Pacific
Reply:
Yes, your line breaks delimit each command. But if you want to combine multiple commands on one line, you can separate with the semicolons:
Summary: Hello, I tried to create a tar file in zip format as following:- [thomas@localhost assignment_3]$ tar -cvfz ass3.tgz * tar: ass3.tgz: Cannot stat: No such file or directory ass3 assFiles.tar : : worki...
Summary: Here's a method I use to find new files and I've modified it to create a link. No need to keep a log with this method BUT it does assume that this process runs every hour. ===========================...
Summary: I have a customer with SCO Unix and Windows . He has is a program that can create a large textfile. What he will use this program for is to create a text file that will contain a large amount of cu...