+ Reply to Thread
Results 1 to 3 of 3

Parsing text file for input to workbook

  1. #1
    Registered User
    Join Date
    04-20-2011
    Location
    Richland, WA
    MS-Off Ver
    Excel 2003/2007
    Posts
    31

    Parsing text file for input to workbook

    Good Afternoon

    A software package creates a text data file to store input parameters. The text looks like the following in Notepad:

    Begin Container
    Begin Void
    Value = 3686
    Units = in^3
    End Void
    Begin Mass
    Value = 12800
    Units = lb
    End Mass
    Begin BeMass
    Value = 0
    Units = kg
    End BeMass
    End Container

    I would like to open the file, grab the data (e.g. void value of 3686 and its units in in^3) and place the information in workbook cells. I'm not sure how to parse the text to get the desired information and then move to the next target.

    Need a push start.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    14,885

    Re: Parsing text file for input to workbook

    When I want to do something like this, I use the "import external data command." In 2002, it's in the Data menu -> Import external data -> Import data. (I can't remember how to find the command in 2007 version, but I know it's there somewhere) Then locate the text file and work through the text import wizard. It looks to me like you might want to use the "=" sign as a delimiter, which will put all your values in column B (assuming you import the file starting in column A). Then, you should be able to put functions in another part of the worksheet to extract the values/units and collect them.

  3. #3
    Registered User
    Join Date
    04-20-2011
    Location
    Richland, WA
    MS-Off Ver
    Excel 2003/2007
    Posts
    31

    Re: Parsing text file for input to workbook

    Thank you responding.

    I'll try it and see how it works. I'm still more interesting in surgically extracting the data in code and only copying the specific data I'm looking for.

    Bob

+ 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