+ Reply to Thread
Results 1 to 4 of 4

importing data into excel from a text file

Hybrid View

  1. #1
    Registered User
    Join Date
    01-22-2007
    Posts
    6

    importing data into excel from a text file

    Hello all- glad I found your forum!

    I have a question:

    I'd like to know if/how this is possible using excel.I'd like excel to "scan" a text file and import:

    1.ALL the lines of text before a line that contains a certain character , * for example

    2. ONLY text thereafter that is bound in parenthesis.

    Total newbie, any help would be greatly appreciated

    Thanks Alot,

    Scott L.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,391
    Does it all have to be done in one step? My personal preference for something like this is usually to use the Data->Import Data-> Import External data command. Work through the text import wizard (hopefully your text file is set up so that it will be easy to parse into columns). Then you can use filters and/or pivot tables to extract the desired data into other cells.

    If you have to do it in one step, or your text file isn't easily parsed, then you may end up using VBA to do this.

  3. #3
    Registered User
    Join Date
    01-22-2007
    Posts
    6
    Thanks Mr.Shorty.I'd like to be able to do it all in one step.How do I access VBA within excel?

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,391
    As mentioned in your other thread, probably the easiest way is to use the macro recorder. You can then access the code for modification in the VBA editor (alt-F11 or in the Macro submenu).

    Even then, you might end up needing to use the open and input # statements to access the file the way you want. It's not the kind of programming I normally do, so I'm not real good at it. As I said, I usually use the data import command and extract the data after it's imported. I'm usually not one to try to do it all in a single step.

+ 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