how to redirect output of command line execution to more than one file according to weight of output

0

Currently I'm using an awk line to filter a set of files according to certain criteria.

How can I redirect the result output to more than one file if the result, for example if the file that would be generated is larger than 1 Mb or has more than N lines? I want to name my results result_1.txt, result_2.txt, etc.

p.s: I want to split my result in files of 1Mb or N lines

Lucia

Posted 2012-02-06T19:58:06.683

Reputation: 161

Answers

2

Pipe the output to split

man split

SiegeX

Posted 2012-02-06T19:58:06.683

Reputation: 1 911