Operating System - HP-UX
1833596 Members
3533 Online
110061 Solutions
New Discussion

Bypassing csplit out of range error

 
SOLVED
Go to solution
Michele (Mike) Alberton
Regular Advisor

Bypassing csplit out of range error

Hi !

I have the need to split a large column file in smaller files using regular expression patterns.

I've tried with csplit but since one of the args does not have a matching pattern in the original file the csplit exits with an out of range. I'm not able to control the content of the file, so that I have to assume a plain distribution of the strings. Is there any way to tell csplit to keep processing the arguments following the one which fails ?

Thanks a lot folks !

Mike
2 REPLIES 2
Bernhard Mueller
Honored Contributor
Solution

Re: Bypassing csplit out of range error

Mike,

use grep -c for each pattern first, if not equal 0 you can include it as argument for cplit.

Regards,
Bernhard
Michele (Mike) Alberton
Regular Advisor

Re: Bypassing csplit out of range error

Yep, I got the same idea, and it's good, thanks a lot, and enjoy your points !

Mike