Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: using the system command

by moritz (Cardinal)
on Jul 01, 2011 at 10:55 UTC ( #912330=note: print w/replies, xml ) Need Help??


in reply to using the system command

But my script overwrites the earlier data.

Well, then don't do it. Chose a different name for the output file each time you run the system command.

Replies are listed 'Best First'.
Re^2: using the system command
by viktor (Acolyte) on Jul 01, 2011 at 11:00 UTC
    thanks but i I have to do that same thing 1000 times as the array is catching some of my intended data and it is a long file so i cannot generate hundreds of files .Is that its the fault of the software as I cannot automate it .

      viktor:

      If you're on a unix box, then you can glue files together like this:

      generatefile foo cat foo >>the_big_file generatefile foo cat foo >>the_big_file

      So you can use the same trick in your script. If you're on DOS, there's a similar trick using copy, but you'll have to read the help page on it, as I don't recall it well.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

      So you neither want to override the files, nor do you want to preserve them. What do you want?

      and it is a long file so i cannot generate hundreds of files

      Uhm, why not? A decent computer can handle hundreds of long files, whatever that means.

      If disc space is an issue, you could compress the files after they are generated. Or extract the information you want from them, and then delete them.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://912330]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-07-17 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (353 votes). Check out past polls.

    Notices?