Concatener deux infos sur une même ligne
Résolu
Ka-El
Messages postés
260
Date d'inscription
Statut
Membre
Dernière intervention
-
Ka-El Messages postés 260 Date d'inscription Statut Membre Dernière intervention -
Ka-El Messages postés 260 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- Concatener deux infos sur une même ligne
- Concatener deux cellules excel - Guide
- Partager photos en ligne - Guide
- Comment faire deux colonnes sur word - Guide
- Mètre en ligne - Guide
- Deux compte whatsapp sur le même téléphone samsung - Guide
5 réponses
hello
$ awk -F "F|[.]" '{print $0, $2}' toto.txt
-rw-rw-r-- 1 toto groland 2344 Oct 10 16:38 /toto/groland/tmp/F0378600 0378600
-rw-rw-r-- 1 toto groland 60500800 Oct 10 16:57 /toto/groland/tmp/F0378709 0378709
-rw-rw-r-- 1 toto groland 60500840 Oct 10 16:57 /toto/groland/tmp/F0378709.pi99 0378709
-rw-rw-r-- 1 toto groland 1824 Oct 10 17:53 /toto/groland/tmp/F0378744 0378744
-rw-rw-r-- 1 toto groland 2084 Oct 11 00:39 /toto/groland/tmp/F0378929 0378929
Salut,
$ cat fich
-rw-rw-r-- 1 toto groland 2344 Oct 10 16:38 /toto/groland/tmp/F0378600
-rw-rw-r-- 1 toto groland 60500800 Oct 10 16:57 /toto/groland/tmp/F0378709
-rw-rw-r-- 1 toto groland 60500840 Oct 10 16:57 /toto/groland/tmp/F0378709.pi99
-rw-rw-r-- 1 toto groland 1824 Oct 10 17:53 /toto/groland/tmp/F0378744
-rw-rw-r-- 1 toto groland 2084 Oct 11 00:39 /toto/groland/tmp/F0378929
$ sed 's/\(.*F\)\([^.]*\)\(.*\)/\1\2\3 \2/' fich
-rw-rw-r-- 1 toto groland 2344 Oct 10 16:38 /toto/groland/tmp/F0378600 0378600
-rw-rw-r-- 1 toto groland 60500800 Oct 10 16:57 /toto/groland/tmp/F0378709 0378709
-rw-rw-r-- 1 toto groland 60500840 Oct 10 16:57 /toto/groland/tmp/F0378709.pi99 0378709
-rw-rw-r-- 1 toto groland 1824 Oct 10 17:53 /toto/groland/tmp/F0378744 0378744
-rw-rw-r-- 1 toto groland 2084 Oct 11 00:39 /toto/groland/tmp/F0378929 0378929
Re-
Si tu tiens absolument à le faire en shell bash :
Si tu tiens absolument à le faire en shell bash :
#!/bin/bash while read line do A="${line#*F}" B="${A%.*}" echo "${line} ${B}" done < fichier
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question