+ Reply to Thread
Results 1 to 2 of 2

Issue with line wrap in source txt file when importing- please help

  1. #1
    KR
    Guest

    Issue with line wrap in source txt file when importing- please help

    I am getting a text file whose source I have no control over. In this text
    file, when I use the import wizard in excel, I can parse each line in all
    the right places, and pull my data into a worksheet.

    However, when I use the commands to read a line at a time (I need the stuff
    in an array, but don't need it actually imported into a worksheet) such as:

    Open LongFN For Input As #1
    Do While Not EOF(1)
    Line Input #1, LineofText

    the lines that are wrapped in the file end up coming in as /multiple/ lines
    when I read the file a line at a time.

    I have almost 30 discrete groups of data in some lines, so they wrap up to 3
    or 4 lines. Trying to reconstruct the data from multiple lines (each data
    group might have a different number of lines) would be a nightmare.

    Is there a setting or a way to read a line all the way to the next "line
    break" as seen by the import wizard, rather than truncating each line at
    whatever the current setting is (probably 80 chars)? In the import wizard it
    looks like the maximum is just over 700 characters. I suspect the issue is
    that Line Input looks at either Chr(13) or (Chr(10)&Chr(13)), but I want it
    to skip any Chr(13) and keep reading automatically until it hits a
    (Chr(10)&Chr(13))

    Please, please help.
    Thank you,
    Keith

    --
    The enclosed questions or comments are entirely mine and don't represent the
    thoughts, views, or policy of my employer. Any errors or omissions are my
    own.



  2. #2
    KR
    Guest

    Re: Issue with line wrap in source txt file when importing- please help

    Nevermind- I have no idea why, but now it is working as expected. I wish I
    knew why so I could prevent myself from changing back whatever it was that
    fixed it, but at least for now it is working. Yea!
    Thanks,
    Keith

    "KR" <[email protected]> wrote in message
    news:[email protected]...
    > I am getting a text file whose source I have no control over. In this text
    > file, when I use the import wizard in excel, I can parse each line in all
    > the right places, and pull my data into a worksheet.
    >
    > However, when I use the commands to read a line at a time (I need the

    stuff
    > in an array, but don't need it actually imported into a worksheet) such

    as:
    >
    > Open LongFN For Input As #1
    > Do While Not EOF(1)
    > Line Input #1, LineofText
    >
    > the lines that are wrapped in the file end up coming in as /multiple/

    lines
    > when I read the file a line at a time.
    >
    > I have almost 30 discrete groups of data in some lines, so they wrap up to

    3
    > or 4 lines. Trying to reconstruct the data from multiple lines (each data
    > group might have a different number of lines) would be a nightmare.
    >
    > Is there a setting or a way to read a line all the way to the next "line
    > break" as seen by the import wizard, rather than truncating each line at
    > whatever the current setting is (probably 80 chars)? In the import wizard

    it
    > looks like the maximum is just over 700 characters. I suspect the issue is
    > that Line Input looks at either Chr(13) or (Chr(10)&Chr(13)), but I want

    it
    > to skip any Chr(13) and keep reading automatically until it hits a
    > (Chr(10)&Chr(13))
    >
    > Please, please help.
    > Thank you,
    > Keith
    >
    > --
    > The enclosed questions or comments are entirely mine and don't represent

    the
    > thoughts, views, or policy of my employer. Any errors or omissions are my
    > own.
    >
    >




+ 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