Saved Bookmarks
| 1. |
Solve : rename a file from a table?? |
|
Answer» I have a file that gets output every week. I want to append the week number to the END of the file, but it's not the calendar week number using the system clock settings, it would be the retail calendar week. it would be the retail calendar week. Do you mean the 4-5-4 Merchandising Calendar? If so, on what day of the week will the file be output? We are using the 4-4-5 merchandising calendar. In most cases, the file will be output on TUESDAY each week, but it could be Wednesday sometimes. It was be triggered by a user to start the process, but I was trying to avoid them having to rename the file after it was generated. Let me know if you could help! Thanks much.Just to clarify what you want: Quote from: luvsun27 I want to append the week number to the end of the fileDo you mean that you want to append the week number as the last record (line) of the file or that you want to append the week number to the filename? Quote from: luvsun27 Can I set up a table of some sort to look so that I can use the name of the weekWhat do you mean by "name of the week"? You already said you want to use the week number. Do you want to give each week a unique name? Quote from: luvsun27 It was be triggered by a user to start the process, but I was trying to avoid them having to rename the file after it was generatedAgain you mention renaming the file which is somewhat different to appending the week number to the end of the file. Sorry about my confusion.Let me clarify...the name that is output for the file each week is called sales_file_output. I want to save a copy of this file with the week number, so sales_file_output_week1, sales_file_output_week2, etc,etc. Just the name of the file NEEDS to change, not the contents of the file. The file sale_file_output is being loaded into another system, but I want to keep a copy of the file for reference in a backup folder. Thanks again for trying to help!It might be possible to set arrays to suit your purpose but the number of arrays is considerable. Each year, month (Merchandising calendar) and week would need its own array and separate coding to return the week number, then the six week month would also have to be considered in the long term (next six-week-month is in 2012{?}). Also the week number OCCURS in each year (Week1 would show in 2009 and 2010 etc) so renaming files would fail due to DUPLICATION unless the script is changed. As an easy alternative I suggest that you append the date of writing of the file to the filename, it would then be fairly simple to look up a hard copy of the Merchandising Calendar to determine in which week that date falls. Filenames would show as sales_file_output_20090127 etc. Thank you very much for your help...I think I will do just that, put the date at the end of the filename. Thanks agan. |
|