Extracting Numerous Text files into Excel
Since you call these "text files", I'm assuming the data is all plain text
in columns separated by tabs or spaces? If so, is it possible to open one
of these with Word, select your data, use TableConvert Text to Table, and
come up with a nice consistent table?
My thinking is code that can iterate through all the text files in a folder
and open them in Word, convert each block of data into a table, copy that
table and paste it into an Excel file, average each column every 30 rows and
write the averages into your final Excel workbook. If you can't make it the
file into a pretty table, you might be able to scan through the text file
and grab strings from certain locations on each line to write into Excel.
That's my thinking because that's the kind of thing I deal with and how I
would approach it. There may well be an easier way using an Excel data
merge function that I'm not familiar with because I rarely use those. It
may be worth your time to see if you can open a blank workbook and use
DataImport External DataImport Data to get your data in Excel in a
format you can work with. If so, then it probably can all be done by
iterating through all the files and importing. And that's out of my
experience to this point.
Ed
wrote in message
oups.com...
Hence I'm now thinking of taking averages of every 30 lines to reduce
the files. I need help with that as well. I want to write a formula
that takes an average of every 30 lines in the same column. Thanks
|