Re: Finding a string in a file
- From: apogeusistemas@xxxxxxxxx
- Date: 29 May 2007 12:42:36 -0700
On 29 maio, 11:31, Ed Morton <mor...@xxxxxxxxxxxxxx> wrote:
apogeusiste...@xxxxxxxxx wrote:
On 28 maio, 18:37, Janis Papanagnou <Janis_Papanag...@xxxxxxxxxxx>
wrote:
apogeusiste...@xxxxxxxxx wrote:
On 28 maio, 12:34, Ed Morton <mor...@xxxxxxxxxxxxxx> wrote:
Franco wrote:
On May 28, 2:52 pm, apogeusiste...@xxxxxxxxx wrote:
Hi:
I need search a specified string in a file, after the word
"mounting" , like this:
solaris> cat file
netbackup, orac_ux001 backup, streaming yes, multiplexing ok ,
mounting M00541 police enabled, data file
<snip>Which awk command can I issue to extract only the "M00541" string
inside a file ?
<snip>awk '{for (i=1;i<=NF;i++) if ($i == "mounting") print $(i+1)}' file
Is there any way to limit the substring founded in 6 characters ?
I´m getting this:
<snip>
<snip>print substr($(i+1),1,6)
Thank you and sorry for my wrong example !
If you posted an accurate example, I suspect there's an even simpler
solution.
Ed.- Ocultar texto entre aspas -
- Mostrar texto entre aspas -
How could I substitute string "mounting" for "media id" in this
script ?
.
- Follow-Ups:
- Re: Finding a string in a file
- From: Ed Morton
- Re: Finding a string in a file
- References:
- Finding a string in a file
- From: apogeusistemas
- Re: Finding a string in a file
- From: Franco
- Re: Finding a string in a file
- From: Ed Morton
- Re: Finding a string in a file
- From: apogeusistemas
- Re: Finding a string in a file
- From: Janis Papanagnou
- Re: Finding a string in a file
- From: apogeusistemas
- Re: Finding a string in a file
- From: Ed Morton
- Finding a string in a file
- Prev by Date: Re: Extracting path components from an absolute path
- Next by Date: Re: Finding a string in a file
- Previous by thread: Re: Finding a string in a file
- Next by thread: Re: Finding a string in a file
- Index(es):
Relevant Pages
|
|