Results 1 to 8 of 8

import data from .txt file selected by user

Threaded View

  1. #1
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    import data from .txt file selected by user

    Hi everyone. I've been working on a homebrewed file cataloging system for our design information and have some separate system ideas that I'd like to put all together in Excel.

    Here's the grand goal: Make a catalog of all the files and folders, including subdirectories and their contents which has links to each file (folders not necessary) and can be sorted, populated with extra information for the files, and is generic enough to be a click-and-run type system.

    Specifically, I'm using the dir DOS command to make the data file. Each line of the file is it's own data entry, so I don't have to worry about delimiters. I'd like to have an excel macro that will bring up the File->Open dialog window and let the user browse to and select the file they want to open.

    I can easily use the macro recorder to do this for a specific file, but I can't figure out how to modify things to let it work for any data file the user cares to select. Alternately, I've found code that lets users select and open the data file they want, but it's a specific example with delimiters involved, and I can't figure out how to prune that code to be what I need.

    Does anyone have suggestions? Also, could I get the macro to actually execute the .bat file I'm using to create the data file, and then open the file and pull out the data? EDIT: Could it all be rolled together so that the macro asks the user to browse to the directory to be cataloged, creates the correct DOS dir command batch file, executes that batch file, then imports the data? :EDIT

    Thanks in advance to anyone who offers their opinions or advice!

    -Adam Hartman
    Mechanical Engineer
    Zyvex Instruments, LLC
    Richardson, TX
    Last edited by ahartman; 02-27-2008 at 05:09 PM. Reason: clarifying intentions for an all-in-one desired function

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