Import File Line by Line

H

Haarish

Hi All,

I have written a function that will open a delimited file, read it
line by line and copy it into different rows under column A of a
sheet. Once it is done, I then compute the last row of data in the
sheet and then to a 'Text to Columns' from A1 to A LastRow.

But the file I import could have fields that are Unicode. So I have a
file that has a text like 'Ä'. The ASCII value for it is 269. The
macro replaces this 'Ä' character with a new line. I think that is
because after 255, the count starts from 0 again and since Chr(13) is
the character for carriage return it adds the text to a new line. Do
you have any idea as to how to stop the function from doing this. I do
not want to read the file character by character since the contents
could be really large.

Thanks in advance,
Haarish.
 
J

Joel

You have only tow choices.

1) Open the file as binary reading the data as words (not bytes) reading the
data one word at a time. Text to columns won't work since the delimiter
characters are now 16 bits instead of 8 bits.

2)Open the file as text and use Text to Columns. You will loose the unicode
characters.


You can open as binaray and use READALL but you will still have to process
the data after you get into excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top