Text files in ascii format

  • Thread starter Thread starter Graham W
  • Start date Start date
G

Graham W

I am trying to write a file to disk in ascii format for
an old mainframe system.
I can get the unicode without difficulty but I cannot
save the text as ascii.

I have tried strconv() but i am obviously missing the
point of the function. It converts to ANSI but I find
that words like ATLAS become chinese characters.

Please help
 
While I guess it depends on what mainframe you're talking about, in my
experience they didn't use ANSI, but rather EBCDIC. Do a Google search on
+EBCDIC +ASCII +conversion. (I used to have a routine that would do it, but
unfortunately I can't find it anymore.)
 
You'are right in that it is not ANSI but it is ASCII

IT's the unicode to ASCII that is causing the problem.
Prior to office 2000 we could just writeline the text to
an ASCII file now, logically, it is unicode but I have
one person who can't read unicode so I need ASCII.

Excel can save is as an ASCII csv fine but it changes
other data formats (like dates) that can't be used.

thanks

Graham
 
Hi Graham,

When you say "writeline", are you using a TextStream object? If so,
check that when you're creating the corresponding file
(FileSystemObject.CreateTextFile, perhaps) before you start writing that
you're creating an "ASCII" file and not an Unicode one. The syntax is

object.CreateTextFile(filename[, overwrite[, unicode]])

and the "unicode" argument should be False or omitted for an "ASCII"
file.

Alternatively, what happens if you write the file with the old Print #
statement instead of using a TextStream?
 
Well Done
You were right!
I was using a textstream and in one of the subroutines I
had opentextstream, true,true. So it was always going to
be unicode

Brilliant!

thanks

Graham
ps I knew that if I contributed over the years to varoius
forums that I would get a payback and this was it!
Thanks again!

-----Original Message-----
Hi Graham,

When you say "writeline", are you using a TextStream object? If so,
check that when you're creating the corresponding file
(FileSystemObject.CreateTextFile, perhaps) before you start writing that
you're creating an "ASCII" file and not an Unicode one. The syntax is

object.CreateTextFile(filename[, overwrite[, unicode]])

and the "unicode" argument should be False or omitted for an "ASCII"
file.

Alternatively, what happens if you write the file with the old Print #
statement instead of using a TextStream?

You'are right in that it is not ANSI but it is ASCII

IT's the unicode to ASCII that is causing the problem.
Prior to office 2000 we could just writeline the text to
an ASCII file now, logically, it is unicode but I have
one person who can't read unicode so I need ASCII.

Excel can save is as an ASCII csv fine but it changes
other data formats (like dates) that can't be used.

thanks

Graham a
Google search on

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top