Can ruby do this?

Discussion in 'Ruby' started by, Dec 1, 2011.

  1. Guest

    Consider files represented thus:

    X,Y,Z are <header/description lines>
    | is the line which terminates/separates each of the [3 in this case]
    sections of the file.
    1,2...6 are lines that are repeated [hence redundant] in each section.
    a,b,....k are the lines of CONTENTS that you want to end up with.

    The algorithm may be something like this:
    IF any 3 or more consecutive lines of the 1st section
    are repeated in any of the following sections
    THEN delete these <repeats>.

    So you want to end up with:

    PS. this problem is a further refinement of
    < with MaxLineLen= 77 ; lynx-fetch the filed-list-of-URLs and
    append them to File2, each with its header & separator. >

    You want to delete the repeated garbage.
    Like if you d/l 8 pages of a 'publication' each page will have the same
    47-line 'header'.

    So you want to discard the redundant packaging.

    == TIA.
, Dec 1, 2011
    1. Advertisements

  2. Yes.

    Robert Klemme, Dec 1, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?
