Text file format

  • Thread starter Thread starter Gargoyle
  • Start date Start date
G

Gargoyle

I am using Access2003 under Windows XP Home SP2.

I have a suite of simple VBA routines that read in a text log file
generated by my modem (I don't have broadband where I live). I process
selected lines from the file to record durations of any dial-up
sessions so that I can keep track of phone call costs during the
month.

The file has a .txt file extension and the file contains
straightforward text (as far as I can tell) that can be read in
Notepad and other text editors.

Part of the routine copies the text file line by line and then appends
a few characters at the end of the file (three hyphens "---") to make
it easier to see where each session begins and ends when I view the
file in Notepad.

The final four lines of the original file looks like this:-
12-22-2007 10:37:48.077 - TSP(0000): Closing Call
12-22-2007 10:37:48.077 - Session Statistics:
12-22-2007 10:37:48.077 - Reads : 30 bytes
12-22-2007 10:37:48.077 - Writes: 96 bytes

The final FIVE lines of the new output/appended file SHOULD look like
this:-
12-22-2007 10:37:48.077 - TSP(0000): Closing Call
12-22-2007 10:37:48.077 - Session Statistics:
12-22-2007 10:37:48.077 - Reads : 30 bytes
12-22-2007 10:37:48.077 - Writes: 96 bytes
---

but what I actually get is this:-
???????????????'???????????›?????????????????›?????????????????????›?????????????????????????????????›?????????????????????????›??????????????????????????????????›?????????????????????????????????????????????????????????????????????????????›?????????????????????????????????????????????????????????????????????›???????????????????????????????????????????††††††††???›??????????????????†††††††?????????????


Apart from Notepad, the main text editing application that I use is
Programmer's File Editor (PFE). I notice than in PFE the file views
differently than in Notepad, so I suspect that some form of text
encoding is applied (perhaps Unix?).

I have used both Print # and Write # statements in VBA but still get
the same results (apart from the delimiting with Write #).

I'm stumped as to why this should happen.

Is there an obvious reason for this behaviour?
Is there a related option/switch that needs to be set?
 
Have you tried using TransferText to either import or link to the text file?
This would be the easier way to get to that data.
 
Back
Top