Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import File Line by Line
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import File Line by Line
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. "Haarish" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import XML into Excel just get first line (=file) | Excel Programming | |||
Import & Parsing a small 400 line CSV file | Excel Programming | |||
Text File Import leaves a blank row after each line | Setting up and Configuration of Excel | |||
import huge text file line-by-line? | Excel Programming |