ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find the Length of a Text File (https://www.excelbanter.com/excel-programming/391342-find-length-text-file.html)

Dan R.

Find the Length of a Text File
 
I always use this to find the length of a text file but isn't there a
better way?

While (EOF(1) < True)
Input #1, ' text
count = count + 1
Wend

Thanks,
-- Dan


Tom Ogilvy

Find the Length of a Text File
 
Use the LOF command?

--
Regards,
Tom Ogilvy


"Dan R." wrote:

I always use this to find the length of a text file but isn't there a
better way?

While (EOF(1) < True)
Input #1, ' text
count = count + 1
Wend

Thanks,
-- Dan



Rick Rothstein \(MVP - VB\)

Find the Length of a Text File
 
I always use this to find the length of a text file but isn't there a
better way?

While (EOF(1) < True)
Input #1, ' text
count = count + 1
Wend


Count = FileLen("<<path to your file")

Rick

Dan R.

Find the Length of a Text File
 
I think LOF returns the file size in bytes... but I could be wrong...

Thanks,
-- Dan


Dan R.

Find the Length of a Text File
 
That worked... thanks Rick.

-- Dan



All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com