Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
End-of-line markers in tab delimited text file
We have some VBA code in Excel which loads a tab delimited text file into a new sheet using Workbooks.OpenText and then processes it row by row to perform some calculations. Data in the file is in separate sections, each with different formats and the end of each section is marked with a blank line e.g.:
Section 1 Date Amount Description 01-Jul-2004 1 Test desc 1 02-Jul-2004 2 Test desc 2 Section 2 Counter Amount Date Description 1 3 01-Jul-2004 Test desc 3 2 4 02-Jul-2004 Test desc 4 This was working perfectly up until the installation of Office 2003, when errors began. I have traced the problem to the end-of-line markers. The incoming text file uses a '0A' character to indicate the end of each line instead of the more usual '0D0A'. This seems to work fine for most lines, but blank lines are ignored. This results in the section changes being missed and so the code expects data in Section 2 to be in the same format as Section1 and fails. The behaviour can be replicated by opening the file manually from the File menu and going through the text import wizard, this too loses the blank lines (regardless of the File Origin setting). Strangely though, if you right-click on the file in Explorer and choose to open it with Excel, the blank lines are retained. Are there any settings I am missing that will allow the text import to recognise the blank lines marked by '0A'? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
converting line-delimited text into cells | New Users to Excel | |||
Too many markers on line chart makes it a thick line and individual markers cannot be seen | Excel Discussion (Misc queries) | |||
How can I save a file as a comma-delimited text file in Excel? | Excel Discussion (Misc queries) | |||
Export excel file to semicolon delimited text file | Excel Discussion (Misc queries) | |||
Open delimited text file to excel without changing data in that file | Excel Programming |