We have decided to migrate a major portion of our back office operation to A5. In doing so we will need to restructure some data that gets input into A5. Each of the data files has a Name and Ext. such as: 1124.txt, 982.txt, etc... We will need to read the file name and input it as well as the file data itself into a record within the A5 table.
We will have somewhere around 10,000 files that have to go through this process. Currently these data files reside in directories that are date specific, (i.e. 01011999, 01151999 etc), and the files in each directory will have the same file names because the names reflect data from the same physical locations, just a different date.
Once these files have been converted, the operation will be completed, as the future data files will be in the correct format, so they will just need to be appended.
We are considering a couple of approaches to accomplish this task. But because we are somewhat novice to xBasic option 2 may be too sophisticated.
Option 1)
We can manually search in Windows Explorer for the file names that match in the different directories, i.e. all the 982.txt files and manually append them, then manually add the file name as a record. This approach is slow and labor intensive but we can do it with our current experience level.
Option 2)
We create an A5 operation that does the following steps:
1) reads a file in a specific directory i.e. 982.txt,
2) copies the file name into the A5 record (982.txt)
3) copies the data in 982.txt into the same record
4) renames the original file in the directory reflecting a date that was imported into the record itself (982.txt would become 982.txt.01011999 in otherwords a unique file name, so that all the files could be moved to the same dir without over writing.
In this approach I know I would use the FILE.FILENAME_PARSE() function to capture the file name, but I have no idea on how to post the captured file name to the table. I also don't know which functions in Alpha would allow the operation to "step" to the next data file and perform the operation again, as well as stopping after all the files in a dir are completed. I also don't know how to rename the original file based on a field in the imported record.
Does any have recommendations on what we should do?
We will have somewhere around 10,000 files that have to go through this process. Currently these data files reside in directories that are date specific, (i.e. 01011999, 01151999 etc), and the files in each directory will have the same file names because the names reflect data from the same physical locations, just a different date.
Once these files have been converted, the operation will be completed, as the future data files will be in the correct format, so they will just need to be appended.
We are considering a couple of approaches to accomplish this task. But because we are somewhat novice to xBasic option 2 may be too sophisticated.
Option 1)
We can manually search in Windows Explorer for the file names that match in the different directories, i.e. all the 982.txt files and manually append them, then manually add the file name as a record. This approach is slow and labor intensive but we can do it with our current experience level.
Option 2)
We create an A5 operation that does the following steps:
1) reads a file in a specific directory i.e. 982.txt,
2) copies the file name into the A5 record (982.txt)
3) copies the data in 982.txt into the same record
4) renames the original file in the directory reflecting a date that was imported into the record itself (982.txt would become 982.txt.01011999 in otherwords a unique file name, so that all the files could be moved to the same dir without over writing.
In this approach I know I would use the FILE.FILENAME_PARSE() function to capture the file name, but I have no idea on how to post the captured file name to the table. I also don't know which functions in Alpha would allow the operation to "step" to the next data file and perform the operation again, as well as stopping after all the files in a dir are completed. I also don't know how to rename the original file based on a field in the imported record.
Does any have recommendations on what we should do?
Comment