Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2012, 12:34 PM
X82 X82 is offline Importing multiple text files and getting certain figures. Windows XP Importing multiple text files and getting certain figures. Office 2007
Novice
Importing multiple text files and getting certain figures.
 
Join Date: Sep 2012
Posts: 1
X82 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 09-26-2012, 09:29 PM
macropod's Avatar
macropod macropod is offline Importing multiple text files and getting certain figures. Windows 7 64bit Importing multiple text files and getting certain figures. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing multiple text files and getting certain figures. 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
Importing multiple text files and getting certain figures. convert multiple csv files to multiple excel files mit Excel 1 06-14-2011 10:15 AM
Importing multiple text files and getting certain figures. Copying multiple files as text without extensions Metamag Office 3 05-09-2011 06:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft