Skip to content

Tag: awk

Create files in subdirectories with the same name [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago. Improve this question Reading a list with A and B data in 2 columns, iterating row by row, I was createding a seri…

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/’ &#821…

IF statement for different lines [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago. Improve this question Question is simple, but I can’t find a fast and elegant way to solve. I want to decide…

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 Answ…

optimizing awk command for large file

I have these functions to process a 2GB text file. I’m splitting it into 6 parts for simultaneous processing but it is still taking 4+ hours. What else can I try make the script faster? A bit of details: I feed my input csv into a while loop to be read line by line. I grabbed the values from the

Remove newline before a match – Linux

I want to remove the newline before the </script> in my HTML file with a Linux command (sed, awk…). Sample input: Sample output: I tried different syntax, but none of them could do. Answer First of all, as mentioned in the comments Don’t parse XML with Regex! Never do it, never think about i…