I CAN NOT USE OPEN ON THE FILE! IT IS TOO LARGE TO OPEN IN MY OS
With respect, that doesn't make sense. For the file to exist on your system, something must have written to it, and therefore that same something must have opened it.
Likewise, for any shell utility to process it, even if only to split it, it has to open it.
So I can only resort to shell.
If you really need a shell solution, I would recommend asking on a site that specialises in shell - not Perlmonks.com?
However, I think the biggest problem here is your understanding of what open does and means. You can open a file without needing to read the whole thing into memory. You could for instance, open the file, read it in smallish chucks, counting the '>' chars and recording the positions of each as you went through. You would then know how many there are and where they are.
You then decide how to split the file, re-open it and open a split file, read the first chunk bit by bit and write it to the split file. Then close the first split file and open a second, continue reading and writing, opening and closing new files until you have the number of smaller files that you want.
You' have to make sure that you had sufficient disc space (at least double and possibly more) for this to work.
That would be a Perl solution. Maybe if you at least told us which OS you are using then someone might also suggest a more efficient method using a system utility, but you'd be better asking elsewhere for that kind of help.
In reply to Re: get the line of ith occurrence of '>' without OPENING THE FILE
by BrowserUk
in thread get the line of ith occurrence of '>' without OPENING THE FILE
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |