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 character replace over a range
Name: Rags Date: December 23, 2004 at 05:30:30 Pacific OS: Unix CPU/Ram: 128
Comment:
Hi
I need a sed command to replace all characters in a text file except those in a specific range.
i.e
If there is a file with contents:
abcdefghijk
what do i do to replace all characters except those from 3 to 5 with x
Summary: I have a text file containing 100's of thousands of rows. For each line in the file, I want to remove the pipe | character if it exists between position 22 and position 57 on each line. All other pi...
Summary: We have a tilde delimited file with tilde in the character data also. Character data is always in double quotes. For example 1~23~"abc"~1.1~"xy~x" We need to change the tilde in character data to a...
Summary: Andreas, sed (stream editor) will do that. Syntax: sed "s/oldstring/newstring/options" myfile Specify multiple changes at one time with: sed -e -e myfile.sql Output goes to stdout, so redirect your...