[linux-leman] diviser un fichier en 2
sneaky56 at gmx.net
sneaky56 at gmx.net
Thu Apr 24 22:38:02 CEST 2003
"Escario Julien" <pandemik at asylog.net> writes:
> Ben alors j'ai un début de réponse mais je suis novice en bash (mon
> truc c'est plutôt perl) mais voilà pour couper en deux :
>
> pandemik:~$ split -l $((`wc -l <fichier> | mawk '{ print $1}'`/2)) <fichier>
>
> Le problème c'est que ca envoie dans xaa et xab et que si le nombre
> de ligne est impaire, la dernière est dirigée vers xac.
alors pourquoi pas:
$ split -l $(((`wc -l <fichier> | mawk '{ print $1}'`+1)/2)) <fichier>
tom
--
as seen in a signature:
"In an open world without walls and fences,
who needs Gates and windows?"
More information about the gull
mailing list