Skip to content
Advertisement

Tag: sed

How to use sed/awk/grep [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 years ago. Improve this question I have a text given below… Here i dont want string 0.00… from

Fetch latest matching string value

I have a file which contains two values for initial… keyword. I want to grab the latest date for matching initial… string. After getting the date I also need to format the date by replacing / with – In the above example, my output should be 2018-02-05. Here, I am fetching the line which contains initial… value and only getting

sed pattern matching between lines

I am trying to write a sed script to only output the lines of a file if the line has the /pattern/ and is between line x and line y. I have the following: select.sed: If my text.file is the the following: The desired output would be How would I set a range for lines 2-4 and only print values

Using sed with regex to match varying lines

I’m having some issues used sed to match a regex pattern. An example would be with the following lines: spring-core-4.0.0 should be spring-core-4.1.0 spring-web-4.0.0 should be spring-web-4.1.0 I want the regex to match any characters in between spring and the version number. I’m not sure if I need to do something else for sed to remember what those characters are

Unix – Replace column value inside while loop

I have comma separated (sometimes tab) text file as below: parameters.txt: with below code I try to loop through the file and do something I wanted to update the last column of the file to N if the above operation is successful, however below approaches are not working for me: sed ‘s/$f5/N/’ ‘$5==”Y”,$5=N;{print}’ $(echo “$line” | awk ‘$5=N’) Update: Few

Trouble writing bash sed command – regex match

I have a file full of garbage collection information that is irregular, some lines have extra information that I want to initially remove so I can then process the the file as a whole. Unfortunately the line has quite a few special characters and I am struggling with a sed command that manages to match the bit I want to

multi pattern in sed -n

I know there are quite a few questions asked on this topic. But I need help in a case basis.When i try to put more than 3 pattern in the option, i will get the error like that… i only want to print the words in the brackets.. here is the sed command and the output… thanks… sample output Answer

Using sed (or any other tool) to remove the quotes in a json file

I have a json file I want to change it to i.e. convert the requestId from String to Integer. I have tried some ways, but none seem to work : Could someone help me out please? Answer Try or The main differences with your attempts are: Your regular expressions were looking for [0-9] between double quotes, and that’s a single

Advertisement