sed to play with data or parsing your text

To select all the lines starting from STARTING_PATTERN up to  blank line ^$ and then delete those lines. # sed ‘/STARTING_PATTERN/,/^$/d’ filename To edit files in place, use -i option. # sed -i ‘/STARTING_PATTER/,/^$/d’ filename Insert multiple lines into a file after specified pattern. # sed ‘/cdef/r add.txt’ input.txt # sed ‘/cdef/r add.txt’ input.txt input.txt:abcdaccdcdeflineweb …

sed to play with data or parsing your text Read More »