Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
converting line-delimited text into cells Wowbagger New Users to Excel 2 April 29th 10 04:19 PM
Too many markers on line chart makes it a thick line and individual markers cannot be seen denzel Excel Discussion (Misc queries) 2 August 2nd 06 04:06 PM
How can I save a file as a comma-delimited text file in Excel? LAM Excel Discussion (Misc queries) 1 May 3rd 05 10:24 PM
Export excel file to semicolon delimited text file capitan Excel Discussion (Misc queries) 5 April 7th 05 03:06 AM
Open delimited text file to excel without changing data in that file zohanc Excel Programming 1 October 3rd 03 01:06 AM


All times are GMT +1. The time now is 01:26 AM.

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

About Us

"It's about Microsoft Excel"