Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 09-14-2022, 10:17 PM
TheBigBoss TheBigBoss is offline Reading basic .txt file fails, how can it be? Windows 7 32bit Reading basic .txt file fails, how can it be? Office 2010 32bit
Advanced Beginner
Reading basic .txt file fails, how can it be?
 
Join Date: Dec 2016
Posts: 56
TheBigBoss is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Ahh, I see what your problem is. The Split command is not returning a two dimensional array. Have a look at how many 'lines' you have after running the split command.

If you split a string containing carriage returns but don't use those CRs as the split trigger then the result will include those CRs in the middle of the array item. This means that
++ 105<CR>0 ++ splits to become and item in the array which is 105<CR>0
Guessed, thanks for helping. Your input is very helpful... indeed, issue is clearly the line break character.

I generate the .txt file with PHP and I use PHP_EOL for line break, which adds \r, \n\, or both \r\n, depending of server (Windows or Linux) - I need to check this. Also, it seems that opening files in txt mode in Windows will also change CRLF into CR...

Well, I need to do more testing.
a) Use something else than PHP_EOL for line break (in PHP)
b) Clean the line in VBA before splitting, to remove any vbLf, vbCr, vbCrLf and/or vbNewLine.

Thanks a lot

I wish there was a way to avoid this, generating
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
The “spelling and grammar” check fails to work as the number of words in the file exceeds a certain Jamal NUMAN Word 3 09-24-2019 10:45 AM
Reading basic .txt file fails, how can it be? Need plugin for reading+converting *.pdf file into *.doc pstein Word 1 05-24-2015 07:05 AM
Reading pane on TOP? hehunt Outlook 0 04-10-2014 06:34 AM
Reading basic .txt file fails, how can it be? How to save a PPT file in 'Reading View' to be opened always in 'Reading View' ItzVickey PowerPoint 2 08-08-2012 09:23 AM
Reading basic .txt file fails, how can it be? Word Basic 2003 to Word Basic 2007 Incompatibility Mark1110 Word VBA 1 12-29-2010 11:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft