+ Reply to Thread
Results 1 to 3 of 3

Thread: Reading txt file into the buffer

  1. #1
    WannaBeExceller
    Guest

    Reading txt file into the buffer

    I have a text file which is large and I am reading the file line by line. The
    data has some values on each line and it is taking tooo long. I was wondering
    if I could load the file to the buffer or read it as one long string which
    would speed up the transfer into excel. The file has about 900,000 lines and
    I am reading about 40,000.

    The process I am using is reading each line then writing it to the excel
    spreadsheet. I didn't think it should take 15 minutes to do that. Please help
    with tips of reading a text file that can speed up my runs. Thank you in
    advance.

  2. #2
    sebastienm
    Guest

    RE: Reading txt file into the buffer

    Hi,

    Is the data organized as a table?
    Do you need just 40,000 rows based on some criteria?

    If so, you could import the data in an MS Access db's table. Then run a
    query to isolate the rows you need and export the result to excel.
    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "WannaBeExceller" wrote:

    > I have a text file which is large and I am reading the file line by line. The
    > data has some values on each line and it is taking tooo long. I was wondering
    > if I could load the file to the buffer or read it as one long string which
    > would speed up the transfer into excel. The file has about 900,000 lines and
    > I am reading about 40,000.
    >
    > The process I am using is reading each line then writing it to the excel
    > spreadsheet. I didn't think it should take 15 minutes to do that. Please help
    > with tips of reading a text file that can speed up my runs. Thank you in
    > advance.


  3. #3
    Jim Thomlinson
    Guest

    RE: Reading txt file into the buffer

    Based on what you have described you should be loading the data to a database
    of some sort and then dealing with it from there. Excel is not really well
    suited to deal with 900,000 lines of input. Excel can interface with Access
    if you want to use Excel as your front end to deal with the data, via pivot
    tables or queries. You can post your code but I have strong doubts that we
    will be able to speed things up significantly.

    My only suggestion if the database thing is not an option would be to conect
    to the text file via ADO... Here is a link to help you with that if that is
    of interest to you.

    http://www.erlandsendata.no/english/...php?t=envbadac
    --
    HTH...

    Jim Thomlinson


    "WannaBeExceller" wrote:

    > I have a text file which is large and I am reading the file line by line. The
    > data has some values on each line and it is taking tooo long. I was wondering
    > if I could load the file to the buffer or read it as one long string which
    > would speed up the transfer into excel. The file has about 900,000 lines and
    > I am reading about 40,000.
    >
    > The process I am using is reading each line then writing it to the excel
    > spreadsheet. I didn't think it should take 15 minutes to do that. Please help
    > with tips of reading a text file that can speed up my runs. Thank you in
    > advance.


+ 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.2.0