+ Reply to Thread
Results 1 to 5 of 5

Import changing text file to Excel

  1. #1
    Registered User
    Join Date
    04-06-2005
    Posts
    3

    Import changing text file to Excel

    Hello all. Thanks in advance for reading and your help/suggestions.

    I would like to import data from a text file into excel for purposes of graphing, manipulate data, etc. Our Building Automation System sends temperatures and other information into a text file and updates it every 2 hours with additional information. We append the file, so it includes the previous information plus the new data (room temperatures, etc).

    Can we import this data into excel? If so, can anyone be so kind as to list how to do it, or where to get additional info, etc? Does this have to be done in VBA?

    Thanks again,

    Mark G

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Mark

    You can open the text file directly into Excel then manually copy from the text file and paste the data into your worksheet.

    It can also be done using VBA

    It really is up to you as to what method you prefer to use.

    If you prefer to use VBA then
    reply giving details of text file name and location.
    Text file layout
    Spreadsheet layout

  3. #3
    Registered User
    Join Date
    04-06-2005
    Posts
    3
    We wish to make the Excel portion as "Seamless" as possible so neophytes need only view data, not mess with importing files, etc. So, maybe VBA is the way to go if necessary.

    This is what we currently have in our text file:

    1) Automation system dumps new data every 2 hours to an ever growing file. The file is "apended" so it continually grows containing the new (and existing) data. Current file is on C Drive c:/Utility Data/2005/April/KW Trends.txt. There are currently 5 columns in the text file:
    A- Date/Time
    B- kW max (max reading over the month span)
    C- kW average
    D- Total kWh (over month span)
    E- Outside air temperature

    2) We want to "pump" that data into Excel every so often so graphs and charts(set up in excel) can be displayed to provide users with temperature and energy usage information. So, excel will go out and get the updated information every so often and auto update our charts. It will accumulate a monthly amount of data ultimately. Our calculations are:

    A- Date/Time (unchanged)
    B- kW max (highest reading over the range of the month)
    C- kW Average (simply an 'average' calc. results sent to graph)
    D- Total kWh (simply a 'total' calc. Results sent to graph)
    E- Outside Air Temp (Min, Max, Ave)

    3) We will probably set up a whole year's worth of folders and report files in advance. If Excel can do it, we would want it to "switch" and begin gathering data from the next month's folder automatically at the end of each month, i.e.: c:/Utility Data/2005/May/KW Trends.txt, June, etc.

    4) As for the Excel layout. We will have a couple sheets. The numerical data from the text file can go on the second or third sheet. The graphs can be on the first page (so they are readily accessable).

    Setting the calculations and graphs and moving the data around in Excel are not a problem for us. Getting the data to excel automatically IS. The Excel file can be saved in the same folder in C drive as the text file, or another folder if you think it's better. We just aren't sure how to get Excel to go out and "get" the data and update itself.

    Any VB help will be MUCH appreciated, or at least to help point us in the right direction would be MUCH appreciated. Thanks again.

    Mark G
    Last edited by Mark G; 04-06-2005 at 11:35 PM.

  4. #4
    Registered User
    Join Date
    04-06-2005
    Posts
    3
    Anyone?

    Suggestions, Resources? I really need help on this. Thanks,



    Mark

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Mark

    I can assist you with code to do the importing. I have never done anthing with graphs.

    Please supply some additional details

    Does the text file have all data for previous dates deleted from it at on a set date or does it hold vast amounts of old data.

    How often would you like the data to be imported into Excel?
    What is the criteria for keeping the data in Excel eg Last month & this month. - Does this correspond to the data in the text file?

    Is there any charactors that shows where the variuous fields are in the text file.
    eg a comer after each field or are the just spaces

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1