The most simple method within 24x7 to concatenate a series of files is to use FileReadAll, FileWrite pair for reading and writing files. Example: Dim file_list, string Dim file_name, string Dim full_name, string Dim file_num, number Dim no_more, boolean Dim buffer, string // open output file for writing with the Append option enabled FileOpen "\\\\SERVER1\\Out File\\Output file.txt", "StreamMode", "Write", True, file_num // get list of input files Dir "\\\\SERVER1\\In File\\Input file*.tmp", file_list isEqual file_list, "", no_more // loop throught the list LoopUntil no_more, NEXT_FILE // get next file name GetToken ",", file_list, file_name Concat "\\\\SERVER1\\Out File\\", file_name, full_name // perform I/O FileReadAll full_name, buffer FileWrite file_num, buffer // check if there are more items in the list isEqual file_list, "", no_more NEXT_FILE: // close the output file FileClose file_num ================================================ : Unfortunately when I tried the section solution (Run...), I received an : "UNC not supported" error message. : I need the ability to concatenate a series of files that use the UNC for the : server name into an output file that also contains a UNC server. The input : and output paths also contain spaces, so I figure I need quotes around the : paths and file names. : Something like: Run("CMD /b copy "\\SERVER1\In File\Input : file*.tmp" "\\SERVER1\Out File\Output file.txt"", : "", process_id) : What is the most simple method within 24x7 of accomplishing this task? : Thanks again.
|