Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Open FileName For Input vs. FileSystemObject.OpenTextFile
Have strange issue at work. Need to read a report that has been saved as a .txt file, pull out certain info and save in an Excel file for my user.
Using Mid function to grab very specific data from each line read in from input file.
Using the old Open FileName For Input As #1
, my app gets tripped up when it encounters some non-ascii characters that are in a specific column of the input file.
However, if I use FileSystemObject as follows, I can access all info I need without any issues whatsoever with the non-ascii values:
Set fs = New FileSystemObject
Set input_file = fs.OpenTextFile(strMFM032Path, ForReading, TristateFalse)
Do While Not input_file.AtEndOfStream
strFullRecord = input_file.ReadLine
Can anyone explain why that might be?
0 · ·