Thanks for quick replies.

Re. Perldoc's sysread - I see I can read a certain number of bytes from file end, which definitely helps as they grow bigger, but don't I need to read certain number of LINES to put .csv into array? That would be neat. Do I need to open another question for this?

Re. backup management - I certainly can do that but from my POV it makes it slightly more complicated than I want - today's "new" file is tomorrow's "old" and has to be found in the old location and has to have the old filename. Simply appending a few lines seems to be easier, but yes, I already plan to control what scripts I want to execute with a relatively simple BASH program, I can add a line at the end, when everything else is done, and copy "new" files into the place of "old" ones. That's one solution.

Re. push(@file,[4,5,6]); - this sounds exactly like what I was looking for. Alternatively, I see I can open files in append mode but then I'm not sure how I could add multiple lines.

For brevity, in append mode, I'd have to have something like this $csv->print($fh, $row); going in a loop before I close $fh?

push() looks a bit more appropriate, will go an test it.

Re. databases - I plan to work with these files on two different computers alternatively, so sometimes I have to add only one or two lines and sometimes would I need to catch up and add twenty or even two hundred. It's easier to have them in files I can just copy over with a usb stick if need arises. With perl scripts on the same stick I can do my things on practically any computer, I upload results to be seen online anyway.


In reply to Re: Append lines to csv by stangoesagain
in thread Append lines to csv by stangoesagain

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.