Results 1 to 2 of 2
How to change the following line a large file,
-----
25 acc This parameter controls the accuracy.
-----
to the line
-----
500 acc This parameter controls the accuracy.
-----
...
- 01-29-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 4
shell command: search and change a line
How to change the following line a large file,
-----
25 acc This parameter controls the accuracy.
-----
to the line
-----
500 acc This parameter controls the accuracy.
-----
sed/awk/grep?
I cannot really search for 25 and replace it with 500 as there are many instances where 25 occurs within the file. Apart from the number the line is very unique. So I can grep the line, but I do not know how to change that specific entry in that file.
- 01-31-2009 #2Just Joined!
- Join Date
- Oct 2004
- Posts
- 62
cat ...file... |sed 's/25 acc This parameter controls the accuracy./500 acc This parameter controls the accuracy.' > xxx
cp xxx ...file....


Reply With Quote