Hi all, I'm looking for the best approach to create an index in an already indexed text file (DVDbackups) to do the following: Validate the command line argument passed by user so the index number, for example 572, is not used again and the user gets prompted to use the next number in the queue (obviously 573). My approach would be to search through the DVDbackups file for the latest (if there is a way of checking for a date the index had been written to file) or last index added to the file (maybe by looking for the bottom index of the file) and do a string search for the last index number used and then finally suggest the number to the user or just make sure the user doesn't use that number or previous numbers again (like an error trap). Any help is much appreciated. Thanks

In reply to Best approach to validate a command line argument against an index in a file by mgrangeiro

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.