#1
|
|||
|
|||
Importing multiple text files and getting certain figures.
Hi guys.
I will try to explain this situation best I can. I have about 500 .txt files. Here is a link to example files, 4 in total. The red parts of the files are the figure I need importing into excel. So there is about 500 txt files with 4 different variations of the file. I also would like to import the filename of the txt file in a column. So column A would read, AMAB3.txt and column B would be the figure pulled from the txt file, say 1.9 or 5.6 etc. In a long list. I'm sorry if I've explained this terribly and I will try to clear up any issues. All help on this matter is appreciated. |
#2
|
||||
|
||||
Hi X82,
Having a macro open and read all the files isn't especially difficult, nor is captuing their names in an Excel workbook. However, extracting the correct data from four different formats is problematic. To be able to do that, the files would need to contain something that is unique to each format so the code can differentiate one from the other. For example: File1 contains the string 'IMax IMin' File2 contains the string 'Switched Rack PDU' File3 contains the string 'Pwr.kW' File4 contains the string 'I Ph1 I Ph2 I Ph3', which none of the others contain. If those strings are always present in those formats only, they could be used for differentiation purposes. Further, while all these data can be imported into Excel, it seems to me that you're capturing different fields, so I'm not sure you'll be able to make much use of it if it all goes onto the same worksheet. It might be better if the data for each format were written to different worksheets. If you can clarify the above issues, we can make some progress.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
searching for text in multiple excel files | roytom | Excel | 2 | 07-30-2012 01:57 PM |
embedding figures from files | luckycharms | Word | 8 | 05-17-2012 05:17 PM |
convert multiple csv files to multiple excel files | mit | Excel | 1 | 06-14-2011 10:15 AM |
Copying multiple files as text without extensions | Metamag | Office | 3 | 05-09-2011 06:25 PM |