Afficher un message
Vieux 29/05/2007, 22h46   #15
Ed Morton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Finding a string in a file

apogeusistemas@gmail.com wrote:
> On 29 maio, 17:07, Ed Morton <mor...@lsupcaemnt.com> wrote:
>
>>apogeusiste...@gmail.com wrote:
>>
>><snip>
>>
>>>I need find DAY128 string after "media id" string:
>>>solaris> cat file

>>
>>> TIME SERVER/CLIENT TEXT
>>>05/29/2007 15:18:35 smmtzsux001-bkp smmtzslx002 client smmtzslx002
>>>handling
>>> path /full_CORP_on_4fiiupcc
>>>05/29/2007 15:18:35 smmtzsux001-bkp smmtzslx002 starting backup job
>>> (jobid=207,827)
>>>05/29/2007 15:18:43 smmtzsux001-bkp smmtzslx002 begin writing backup
>>>id
>>> smmtzslx002_1180441115, copy 1, fragment 1, to
>>>media id
>>> DAY128 on drive index 5

>>
>>Is your input file really split such that "media id" occurs on it's own
>>on the line after "to" and before the line that starts with "DAY128"?
>>The solutions will be pretty different based on whether or not what
>>we're seeing is caused by line-wrapping of your posting.
>>
>> Ed.

>
>
> to media id DAY128 on drive index 5
>


awk 'sub(/.*media id /,""){print $1}' file

Ed.
  Réponse avec citation
 
Page generated in 0,04913 seconds with 9 queries