0

I'm trying to concatenate all the files of a that ends with coref extension.

This works (but add unwanted files):

find ../corpus/dev/txt/ | xargs cat

This not works.

find ../corpus/dev/txt/ -name '*.coref' | xargs cat

In the second comand find returns 1566 results but xrags cat does nothing.

Why the -name arguments mess it all?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Nasgar
  • 859
  • 2
  • 11
  • 26

1 Answers1

0

Try to use -print0 like this:

  find ../corpus/dev/txt/ -name '*.coref' -print0 | xargs -0 cat

if you find to many files and the xargs list gets too long, you can try this:

  find ../corpus/dev/txt/ -name '*.coref' -print0 | xargs -n1 -0 cat >> /tmp/file
Jakob Kroeker
  • 333
  • 2
  • 15
hashier
  • 4,670
  • 1
  • 28
  • 41