Hello, Monks, I have post it before but it seems to me I am not making myself clear. The toughest situation is: I CAN NOT USE OPEN ON THE FILE! IT IS TOO LARGE TO OPEN IN MY OS. So I can only resort to shell.
I got stuck with a problem of getting the line with ith occurrence of a symbol, '>' in this case, from a file. I have 3 million '>' in my file. What I want to do is to split the file into 8 pieces that I have even number of '>'s in each file. (the file contains other things and I do not know where these '>' locate). The file is too large to get open in memory. I read sth about csplit but it split a file whenever it sees a '>'. So I am thinking maybe I want to get the line of the 10000th '>' and use it for csplit. Does anyone have better idea or how I can get the line? Any of your idea or hints will be highly appreciated. Ginger

In reply to get the line of ith occurrence of '>' without OPENING THE FILE by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.