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, search/replace w/in range
Name: hack1234 Date: February 21, 2007 at 11:09:29 Pacific OS: AIX 5.3 CPU/Ram: na Product: IBM
Comment:
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 pipe characters should remain in tact, just want them removed from positions 22 - 57. I know how to use sed to remove all pipes from the file but cannot figure out how to limit my search/replace to a range of characters. Can anyone help? Thanks!
Summary: 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...
Summary: Replace /MM_VERSION_STR/ in the above by: $1 == "#define" && $2 == "MM_VERSION_STR" in case MM_VERSION_STR appears elsewhere in the same file. ...
Summary: i need to search for *.txt in the current directory(excluding sub-directories) and need to itirate through each *.txt i.e. my requirement is to pick each *.txt in the current dir n pass it to other sc...