Tagged Questions
0
votes
1answer
101 views
comparing lines with awk vs while read line
I have two files one with 17k lines and another one with 4k lines. I wanted to compare position 115 to position 125 with each line in the second file and if there is a match, write the entire line ...
0
votes
2answers
371 views
Sed find/delete for a string with multiple special characters recursively
I'm having quite a bit of difficulty with a complex string. A friend's site was hacked and has since been locked down but I'm helping to clean up the mess leftover and what I need to do is the ...
2
votes
2answers
249 views
remove only specific text occurrences from string using sed
I have a text file that contains many rows of this sort of thing:
/*[17:51:27][1 ms]*/ UPDATE `country` SET `region_id` = '4' WHERE `country_id` = '36';
Is there a way that I can use sed to remove ...
4
votes
2answers
963 views
How to search and replace multiple needles by one word via one expression?
Assume you have a text file:
foo fnord bar
bizz foo poit
And now I would want to replace both "foo" and "bar" into "narf".
I know I could use:
sed -e 's/foo/narf/g' -e 's/bar/narf/g' fileName
...