LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Checking for CR/LF in text file.

Hi Guys,

Does anyone know how I would check that each line of a text file is
terminated with a CR/LF pair?

My macro needs to check the formatting of each line of a CSV file to
make sure it will load properly into a different application (This
part is nice and easy). Because each record/line in the file is
transactional in nature Excel is perfect for this but the one quirky
thing is that each line in the file must be terminated with a CR/LF
pair.

Any help will be appreciated.

I've tried working with something like this but each method reads the
line before termination? -

....
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("C:\TEST.TXT", ForReading, TristateTrue)
currentLine = f.ReadLine
....
and also
....
Open "C:\TEST.TXT" For Binary As #1
Line Input #1, LineofText
....

Cheers,
Deon Murtagh

 
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
Checking to see if a file exists. JHB Excel Discussion (Misc queries) 3 August 5th 09 03:11 PM
checking if file is saved John Excel Programming 1 August 29th 04 11:09 AM
Vba - Checking existence of file ajliaks[_26_] Excel Programming 1 August 11th 04 06:43 PM
Checking if file exists in VBA NADavies Excel Programming 3 October 23rd 03 02:16 PM
File Checking Donald Lloyd Excel Programming 2 August 3rd 03 04:58 PM


All times are GMT +1. The time now is 03:20 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"