Skip to content

Tag: text-processing

sed command to copy lines that have strings

I want to copy the line that have strings to another file for eg A file contain the below lines I want to copy the lines that has 100 or 200 to another file by skipping all the characters before (first occurrence in a line)100 or 200 I want it to copy 100 50 200 40 100 34 to another

Sed/awk: Aligning words in a file

I have a file with the following structure: I want to add another item to the file, using sed or awk: etc. So my next item looks like this: The column values is jagged. How do I align my values to the left like for previous items? I can see 2 solutions here: To align the values while inserting them

Storing awk manipulation in variable

I have two text files in tab delimted format like following. file_1 file_2 these two file contents were stored into two different variables. Now I would like extract the lines which has “+” symbol in column 4 and store it in the variable and later print it. But it throws me error message: Here is …