emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#8796: closed (I need help piping csplit)


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8796: closed (I need help piping csplit)
Date: Fri, 03 Jun 2011 21:45:03 +0000

Your message dated Fri, 03 Jun 2011 15:44:04 -0600
with message-id <address@hidden>
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
address@hidden)


-- 
8796: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8796
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: I need help piping csplit Date: Fri, 3 Jun 2011 14:46:26 -0500 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  //                        
   |_ |_




--- End Message ---
--- Begin Message --- Subject: Re: bug#8796: I need help piping csplit Date: Fri, 03 Jun 2011 15:44:04 -0600 User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]