Probleme avec awk -F

amsy10 -  
 amsy10 -
Bonjour,

je voudrais avoir la premiere colonne de mon fichier fic1, voilà le contenu

052537779 |684443 | 102000 |14-FEB-10 10.29.06.241944 AM
004976269 |694711 | 251000|14-FEB-10 05.20.19.968168 PM
004976270 |294711 | 250300|14-FEB-10 05.21.52.599103 PM
004976274 |382324 | 250040|14-FEB-10 08.18.42.857193 PM

J'ai fais :
awk 'BEGIN {FS=' | '} {print $1}' detail_voucher_20110215.lst | head

Pourriez-vous me guider?

Best regards/

3 réponses

  1. dubcek Messages postés 18627 Date d'inscription   Statut Contributeur Dernière intervention   5 659
     
    hello
    essayer avec
    awk 'BEGIN {FS="|"} {print $1}' detail_voucher_20110215.lst | head 
    1
  2. zipe31 Messages postés 34620 Date d'inscription   Statut Contributeur Dernière intervention   6 501
     
    Salut,

    'BEGIN {FS=' | '}
    Il y a un espace en trop après le pipe ;-(

    'BEGIN {FS=' |'}

    Devrait mieux le faire ;-))
    0
  3. amsy10
     
    Oui c'est bon Merci infinement ........
    cordialement
    0