Re: Search Problem
- From: Ed Morton <morton@xxxxxxxxxxxxxx>
- Date: Sun, 04 Dec 2005 09:20:04 -0600
pankaj_wolfhunter@xxxxxxxxxxx wrote:
Greetings, I have a file as below
LobFile.txt
1|Charles|test.001.0.1313|123|test.001.0.1423 1|Charles|test.001.1313.3415|243|test.001.1423.3423
Here exp.001.0.1313 and others like it, is a file name with exp.001 as the name of the file and 0 as the starting and 1313 as the ending byte position. This file name appears randomly in many places within the main file(LobFile.txt) having exp.001 as common name with all.
I know the grep command can give me those lines where this name appears but then I don't know at which position within the line that word appears because I need to go to that position in order to fetch and make some modification to that name.
I just need a way to line by line search the entire file, fetching that name whenever it appears, making some modifications and moving further.
I hope I made myself clear. Any help will be appreciated.
It's not really clear, but start with this:
awk -F\| '/exp.001/{for (i=1;i<=NF;i++) if ($i ~ /exp.001/) print NR, i, $i}' LobFile.txt
and let us know what needs to be different.
Ed. .
- Follow-Ups:
- Re: Search Problem
- From: pankaj_wolfhunter
- Re: Search Problem
- References:
- Search Problem
- From: pankaj_wolfhunter
- Search Problem
- Prev by Date: Re: add loop control to skip comments in while loop
- Next by Date: Re: Where is the best place to store temporary files?
- Previous by thread: Search Problem
- Next by thread: Re: Search Problem
- Index(es):
Relevant Pages
|