I’m experiencing a weird problem. I’m using VB 6 to create a small application that reads an automatically-generated plain-text table with 7 fields and will output the data in XML. Each field is a pre-determined length with white space filling the unused portion of the fields. This is the type of thing most of us have done many times, but I’m encountering a strange error with this project.
This problem is this: When the program attempts to read the target file, the ‘white space’ is ignored and the fields don’t divide correctly. However, if I open the file with Notepad the fields are displayed in an orderly semi-table- using the white space to fill the unused portion of each field. What is strange is that if I then save the file in Notepad (without making any changes to the file), and then process the newly saved file from within my program, it works perfectly! The properties page shows the two files to be identical- down to the last byte- but only the resaved file will work.
Within VB, I’ve used the FileSystemObject style and also the Open command to open and read the text; both work great on the resaved file, but neither can ‘see’ the white space in the original file.
Does anyone have any thoughts on this problem? Notepad seems to be doing something to the file, but what could that be?