GNU bug report logs -
#8796
I need help piping csplit
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 03 Jun 2011 15:44:04 -0600
with message-id <4DE955A4.3040400 <at> redhat.com>
and subject line Re: bug#8796: I need help piping csplit
has caused the GNU bug report #8796,
regarding I need help piping csplit
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
8796: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8796
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hi I have an issue, I'm trying to split several files into two the first one
is the head of file and the next one has to start with some title, but
csplit don't allowe me to piping, this is how i'm doing
$> find ./ -name '*out' | xargs csplit '/All Frequencies/' '/Statistical/'
I have to now all the locations of files that ends with "out", next every
time the command finds a file I want to csplited but terminal sends me an
error:
csplit: cannot be open «/Statistical/» to read: file or extension don't
exist--
*
*_¬\_ ___________________________
( ¬¸> || Julio César González Torres||
| \ »── || UAM-Azcapotzalco FAMA ||
| V() ─────────────────────
L //
|_ |_*
*
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (text/plain, inline)]
tag 8796 notabug
close 8796
thanks
On 06/03/2011 01:46 PM, Julio Cesar Gonzalez Torres wrote:
> Hi I have an issue, I'm trying to split several files into two the first one
> is the head of file and the next one has to start with some title, but
> csplit don't allowe me to piping, this is how i'm doing
>
> $> find ./ -name '*out' | xargs csplit '/All Frequencies/' '/Statistical/'
>
> I have to now all the locations of files that ends with "out", next every
> time the command finds a file I want to csplited but terminal sends me an
> error:
>
> csplit: cannot be open «/Statistical/» to read: file or extension don't
> exist--
Thanks for the report. However, this is not a bug in coreutils, but in
your usage of xargs. So I'm marking it closed.
It helps to insert 'echo' prior to 'csplit' to see what you are calling:
csplit '/All Frequencies/' '/Statistical/' file1out file2out ...out
But csplit is documented as requiring a single file name, followed by
multiple patterns.
What you WANT to do is:
find . -name '*out' | \
xargs -I{} csplit {} '/All Frequencies/' '/Statistical'/
The use of -I{} forces xargs to use one file per csplit invocation
(instead of cramming in as many files as possible), as well as to let
you choose where to substitute the file name 9rather than cramming it on
as the last argument).
--
Eric Blake eblake <at> redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 13 years and 361 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.