0
votes
4answers
158 views

Search for a Value only in one column w.o using awk, sed, or perl

I have a file that looks like this : Marketing Ranjit Singh FULLEagles Dean Johnson Marketing Ken Whillans FULLEagles Karen Thompson Sales Peter RobertsonPARTGolden ...
2
votes
2answers
169 views

How to search and replace strings matching a replacement list for multiple files

I have a file, say map.txt, containing a list of search strings and corresponding replacements: search -> replacement bigBone -> bb fishMarket -> fm dogCollar -> dc ... I need to ...
1
vote
2answers
71 views

Mailing out a customised content based on specific search in a logfile

Using below test.sh, I am getting result in dump.txt as below: test.sh: #!/bin/bash #"Maxl-script" zone starts..... essmsh -l admin password -s localhost -i << EOF spool on to 'dump.txt'; ...
0
votes
1answer
112 views

How can I pass in a parameter to sed?

To be more precise - how can I pass in a parameter to a program that then calls sed - how can I 'pass' that parameter along? I have a file 'source_code.sc'. I have a sed script "find_expect": #n ...
0
votes
1answer
694 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
3answers
665 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
505 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
2k 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 ...