Hi everybody.
I would like to have some tips about a case I have in my project.
I need to read a database daily, several times per day, and during the day I need to 'append' a file with these data and, when the day changes, the file must be overwritten and then start to 'append' it again.
PS. I can't create different files - one per day. The file must be the same: with the same name. We just overwrite it according to the date changing.
How can I make this control?
Thanks my friends.
Best regards,
How do I append a file today and overwrite it tomorrow?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 298
- Joined: Tue Aug 26, 2008 12:17 pm
How do I append a file today and overwrite it tomorrow?
Joyce A. Recacho
São Paulo/SP
Brazil
São Paulo/SP
Brazil
Hi Joyce.
What is behind the requirement that the file have the same name every day? My assumption for the rest of this post is that it is used by a subsequent job or process.
I have a similar situation in the other direction. I overwrite the same initial file every day, then have a process that makes a final edit to it, but the edited file has a unique name every day (current date in the file name).
I don't know if this will help, but one way to approach this:
Append to a uniquely named file each day. The current date is a handy way to do that. At the end of the day, copy it to the "must be the same name" file for further processing, and delete the current-date file when that is done.
Edit: Or what Craig suggested.![Embarassed :oops:](./images/smilies/icon_redface.gif)
What is behind the requirement that the file have the same name every day? My assumption for the rest of this post is that it is used by a subsequent job or process.
I have a similar situation in the other direction. I overwrite the same initial file every day, then have a process that makes a final edit to it, but the edited file has a unique name every day (current date in the file name).
I don't know if this will help, but one way to approach this:
Append to a uniquely named file each day. The current date is a handy way to do that. At the end of the day, copy it to the "must be the same name" file for further processing, and delete the current-date file when that is done.
Edit: Or what Craig suggested.
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872