coreutils
[Top][All Lists]
Advanced

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

Re: Splitting search results from a "find -print0"


From: Eric Blake
Subject: Re: Splitting search results from a "find -print0"
Date: Wed, 07 Jan 2015 13:09:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 01/07/2015 11:49 AM, Markus Elfring wrote:
> Hello,
> 
> I would like to use the find command together with
> the parameter "-print0". I want to split the search
> result into a few separate files.
> 
> A command like "split" supports to make pieces from
> an input by a line count.
> Do I read the current documentation correctly in
> the way that zero-terminated lines are not supported
> so far?
> http://www.gnu.org/software/coreutils/manual/html_node/split-invocation.html

Correct.  Patches welcome.  In the meantime:

> 
> Would you like to recommend any other software tools
> which provide the desired functionality for splitting
> of files which contain zero-terminated text lines?

If you don't mind a bit of glue work, you can achieve the same results
with existing tools:

tr '\n\0' '\0\n' < orig > mod
split mod mod.
for each f in mod.*; do
  tr '\n\0' '\0\n' < $f > orig.${f##*.}
done

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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