Search Results

Search: Posts Made By: Beginner101
3,716
Posted By Beginner101
Hi guys sorry for the confusion. Ill explain. ...
Hi guys
sorry for the confusion. Ill explain.

@MadeInGermany:
the solution you provided with pattern/newval works perfectly fine.
I can modify "pattern" to be any portion of the string in each...
3,716
Posted By Beginner101
Thanks , Could you please explain how the sed...
Thanks ,
Could you please explain how the sed is working? so I can understand how to make slight modificiations :)

Also, my input will actually be the whole line:
info:200/text/name1:1.2.300.Y...
3,716
Posted By Beginner101
Thanks! Slight modification to the original...
Thanks!
Slight modification to the original problem:

So previously I wanted to replace the last digit before the single quote at end of line with a new value, but now I want to only do it based...
3,716
Posted By Beginner101
thanks greet_sed! in the second option, the...
thanks greet_sed!
in the second option, the value I want to replace is a variable, not X
so $val=45

I tried this but doesnt resolve $val:
sed -re 's/\.[0-9]{1,2}'"'"'/.$val/' file

so I used...
3,716
Posted By Beginner101
sed replace pattern
I have a file with multiple lines, all in the same format. For each line, I need to replace the sequence of digits after the last : with a new value, but keep the single quote at the end of the line....
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 02:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy