Danny Posted August 22, 2006 Report Share Posted August 22, 2006 I am trying to write a macro that reads a space delimited text file. The file has 8 columns per line. I would like it toaverage the numbers in each of the columns and then output a single line with the averaged results. The text files have 17280 lines per day, and a new one is generated every day. Does anybody have an idea as to how I may go about this? Quote Link to comment Share on other sites More sharing options...
joe Posted August 23, 2006 Report Share Posted August 23, 2006 First you need to convert the space delimited file to a tab or comma delimited file, which is very easy to do. Simply read the file into a string variable, create a loop that converts all double spaces to a single space. Then convert all single spaces to a tab. Save the string back to a file. Now it is just a matter of using the Process ASCII File construct. Read each line in, convert each of the string variables to decimal variables, add the decimals to the totals, and then increment the line counter. At the end, you need to divide each of the column totals by the line counter, then save them to a file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.