Text files in ascii format

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
 
D

Douglas J. Steele

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.)
 
G

Guest

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
 
J

John Nurick

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?
 
G

Guest

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.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top