PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > extract text from a unix flat file
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

extract text from a unix flat file

Réponse
 
LinkBack Outils de la discussion
Vieux 26/04/2007, 12h51   #1
jhd41@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut extract text from a unix flat file

hi all,
I have the following contents in a file, each is 1 line:
64,000 B 04/23/07 07:32:37 M1 A /data/oracle/LNDBDP1/backup/arc2adsm/
LNDBDP1_arc_l0_t620573562_s2398_p1.rmn
1,267,200 B 04/23/07 07:32:37 M1 A /data/oracle/LNDBDP1/backup/
arc2adsm/LNDBDP1_arc_l0_t620574474_s2399_p1.rmn

And I need to extract the *.rmn bit at the the end of the lines not
including the full path.

Any ideas?

Thanks

  Réponse avec citation
Vieux 26/04/2007, 14h04   #2
Ed Morton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: extract text from a unix flat file

jhd41@hotmail.com wrote:
> hi all,
> I have the following contents in a file, each is 1 line:
> 64,000 B 04/23/07 07:32:37 M1 A /data/oracle/LNDBDP1/backup/arc2adsm/
> LNDBDP1_arc_l0_t620573562_s2398_p1.rmn
> 1,267,200 B 04/23/07 07:32:37 M1 A /data/oracle/LNDBDP1/backup/
> arc2adsm/LNDBDP1_arc_l0_t620574474_s2399_p1.rmn
>
> And I need to extract the *.rmn bit at the the end of the lines not
> including the full path.
>
> Any ideas?
>
> Thanks
>


sed 's:.*/::' file

Ed.
  Réponse avec citation
Vieux 26/04/2007, 16h41   #3
Janis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: extract text from a unix flat file

On 26 Apr., 12:51, j...@hotmail.com wrote:
> hi all,
> I have the following contents in a file, each is 1 line:
> 64,000 B 04/23/07 07:32:37 M1 A /data/oracle/LNDBDP1/backup/arc2adsm/
> LNDBDP1_arc_l0_t620573562_s2398_p1.rmn
> 1,267,200 B 04/23/07 07:32:37 M1 A /data/oracle/LNDBDP1/backup/
> arc2adsm/LNDBDP1_arc_l0_t620574474_s2399_p1.rmn
>
> And I need to extract the *.rmn bit at the the end of the lines not
> including the full path.


awk -F/ '{print $NF}' your_file

Janis

>
> Any ideas?
>
> Thanks



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h43.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09973 seconds with 11 queries