Date création : 22-11-2007 13:05:34 Date de la dernière modification : 24-03-2008 19:20:51
 Vous êtes dans : GNU/Linux Astuces / Commandes Linux - exemples utilisation
csplitDESCRIPTION
SYNOPSYS
Exemples
DESCRIPTIONDécouper un fichier en sections déterminées par des lignes de contexte. Lire man csplit pour les détails.
SYNOPSYS csplit [OPTIONS] fichier motif...
Exemple 1Découper un fichier sans changer de prefix (par défaut c'est xx)
lami20j@debian:~$ cat fichier
Chapitre 1
La commande csplit
Chapitre 2
Description de la commande csplit
lami20j@debserv:~/trash$ csplit -z fichier "/^Chapitre/" {1}
32
48
lami20j@debian:~$ ls -l xx0*
-rw-r--r-- 1 lami20j lami20j 32 2007-12-08 16:06 xx00
-rw-r--r-- 1 lami20j lami20j 48 2007-12-08 16:06 xx01
lami20j@debian:~$ cat xx00
Chapitre 1
La commande csplit
lami20j@debserv:~/trash$ cat xx01
Chapitre 2
Description de la commande csplit
lami20j@debian:~$
|
Exemple 2 Découper un fichier en changeant le préfix (par défaut c'est xx, l'option -f permet de changer le préfix)
lami20j@debian:~$ cat fichier
Chapitre 1
La commande csplit
Chapitre 2
Description de la commande csplit
lami20j@debian:~$ csplit -z -f chap fichier "/^Chapitre/" {1}
32
48
lami20j@debian:~$ ls -l chap0*
-rw-r--r-- 1 lami20j lami20j 32 2007-12-08 16:10 chap00
-rw-r--r-- 1 lami20j lami20j 48 2007-12-08 16:10 chap01
lami20j@debian:~$ cat chap00
Chapitre 1
La commande csplit
lami20j@debserv:~/trash$ cat chap01
Chapitre 2
Description de la commande csplit
lami20j@debian:~$
|
|