LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default 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.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
word wrap issue eddieray Excel Discussion (Misc queries) 1 October 15th 08 06:28 PM
Text Wrap Issue Steved Excel Worksheet Functions 0 April 20th 08 11:04 PM
Importing text file with no line delimiters mikewilsonuk Excel Discussion (Misc queries) 4 June 15th 06 06:47 AM
Importing file with fixed width, multi-line records danmcgov Excel Discussion (Misc queries) 7 March 20th 06 08:05 PM
Wrap Text issue jsAlpha Excel Discussion (Misc queries) 2 January 5th 06 01:56 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"