Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default txt-file is in ANSI format or OEM Character format.

Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character format.

--
Best regards from
Joergen Bondesen



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default txt-file is in ANSI format or OEM Character format.

I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed". It is pretty easy to convert a
file from one to the other format.

"Chip Pearson" wrote:

If you know ahead of time what the content of the file is, you can parse out
some known piece of information and look at the character codes. But if you
don't know the content of the file, I don't think you can do what you want.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Joergen Bondesen" wrote in message
...
Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character format.

--
Best regards from
Joergen Bondesen




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default txt-file is in ANSI format or OEM Character format.

Hi Joel.

Thanks for your reply.

I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed".

That is not quite correct. In Denmark we have local letters as æ, ø and å
and therefore I have to change from ANSI to OEM when I am using data in
"old" industrial ink printers.

It is pretty easy to convert a file from one to the other format.


Do you have vba code for both purpose?

--
Best regards from

Jørgen Bondesen


"Joel" skrev i en meddelelse
...
I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed".

"Chip Pearson" wrote:

If you know ahead of time what the content of the file is, you can parse
out
some known piece of information and look at the character codes. But if
you
don't know the content of the file, I don't think you can do what you
want.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Joergen Bondesen" wrote in message
...
Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character
format.

--
Best regards from
Joergen Bondesen






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default txt-file is in ANSI format or OEM Character format.

Now I understand the problem. Have you saved the file as CSV file or other
Text formats. What happens?

to fully understand what is happening you need to save the file and then
open the file with Notepad or some other text editor. Also try printing some
of the text files and see what happends.

The older printers have a smaller character set (number of characters) it
recognizes. When you use excel or other microsoft products such as word you
are using the OEM character set to be compatible with the printer.

You are actually changing the Font and not the word. The font setting are
invisible formatting characters just like Bold setting or color settings.
when you save the file as text all the formating characters are removed.
The solution in word would be to save the file as RTF which keeps the
formating.

You could try copying the file to word and then save the File as RTF.

"Joergen Bondesen" wrote:

Hi Joel.

Thanks for your reply.

I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed".

That is not quite correct. In Denmark we have local letters as æ, ø and å
and therefore I have to change from ANSI to OEM when I am using data in
"old" industrial ink printers.

It is pretty easy to convert a file from one to the other format.


Do you have vba code for both purpose?

--
Best regards from

Jørgen Bondesen


"Joel" skrev i en meddelelse
...
I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed".

"Chip Pearson" wrote:

If you know ahead of time what the content of the file is, you can parse
out
some known piece of information and look at the character codes. But if
you
don't know the content of the file, I don't think you can do what you
want.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Joergen Bondesen" wrote in message
...
Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character
format.

--
Best regards from
Joergen Bondesen







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default txt-file is in ANSI format or OEM Character format.

Hi Joel.

Thanks for reply.

Regret my insufficient explanation in the beginning.



Today I save the Excel file with customer data to a csv-file.

This file I open in UltraEdit (Hex-editor) and change ANSI to OEM and close
then file.

This file I deliver to the production ink-printer.

The operator then load the file into then machine. I do think it is some old
"DOS" because it is not Windows.

Then the operator ink customer data on magazines.



It would be very nice if I could save the Excel-file as an OEM csv-file.



It would also be nice if I could test a csv-file for ANSI/OEM version.


--
Best regards from

Joergen Bondesen


"Joel" skrev i en meddelelse
...
Now I understand the problem. Have you saved the file as CSV file or
other
Text formats. What happens?

to fully understand what is happening you need to save the file and then
open the file with Notepad or some other text editor. Also try printing
some
of the text files and see what happends.

The older printers have a smaller character set (number of characters) it
recognizes. When you use excel or other microsoft products such as word
you
are using the OEM character set to be compatible with the printer.

You are actually changing the Font and not the word. The font setting
are
invisible formatting characters just like Bold setting or color settings.
when you save the file as text all the formating characters are removed.
The solution in word would be to save the file as RTF which keeps the
formating.

You could try copying the file to word and then save the File as RTF.

"Joergen Bondesen" wrote:

Hi Joel.

Thanks for your reply.

I think the only real difference is the end of the lines being a
"carriage
return" or "carriage return and line feed".

That is not quite correct. In Denmark we have local letters as æ, ø and å
and therefore I have to change from ANSI to OEM when I am using data in
"old" industrial ink printers.

It is pretty easy to convert a file from one to the other format.


Do you have vba code for both purpose?

--
Best regards from

Jørgen Bondesen


"Joel" skrev i en meddelelse
...
I think the only real difference is the end of the lines being a
"carriage
return" or "carriage return and line feed".

"Chip Pearson" wrote:

If you know ahead of time what the content of the file is, you can
parse
out
some known piece of information and look at the character codes. But
if
you
don't know the content of the file, I don't think you can do what you
want.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Joergen Bondesen" wrote in message
...
Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or
OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character
format.

--
Best regards from
Joergen Bondesen











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default txt-file is in ANSI format or OEM Character format.

I think there is a simplier solution. Any of the option below can be
converted to a macro if it works.

1) Try saving the file as formatted Text space Delimited.
2) Try printing to a "file" using a OEM Printer or other printer
3) Try copying data to word. Then in word Print to a "file" using different
Printers.
4) Try 2 and 3 above changing formating to a different Font.

You really have a font problem. You need to get the correct Font that will
work with the printer you are using. I can fix any spacing problems you may
have with a macro, we just need to get the characters in the file to be
correct.

Another solution if UltraEdit (Hex-editor) supports a scripting language is
to automatically start the Ultraeditor from excel so the conversion is
automatic.

"Joergen Bondesen" wrote:

Hi Joel.

Thanks for reply.

Regret my insufficient explanation in the beginning.



Today I save the Excel file with customer data to a csv-file.

This file I open in UltraEdit (Hex-editor) and change ANSI to OEM and close
then file.

This file I deliver to the production ink-printer.

The operator then load the file into then machine. I do think it is some old
"DOS" because it is not Windows.

Then the operator ink customer data on magazines.



It would be very nice if I could save the Excel-file as an OEM csv-file.



It would also be nice if I could test a csv-file for ANSI/OEM version.


--
Best regards from

Joergen Bondesen


"Joel" skrev i en meddelelse
...
Now I understand the problem. Have you saved the file as CSV file or
other
Text formats. What happens?

to fully understand what is happening you need to save the file and then
open the file with Notepad or some other text editor. Also try printing
some
of the text files and see what happends.

The older printers have a smaller character set (number of characters) it
recognizes. When you use excel or other microsoft products such as word
you
are using the OEM character set to be compatible with the printer.

You are actually changing the Font and not the word. The font setting
are
invisible formatting characters just like Bold setting or color settings.
when you save the file as text all the formating characters are removed.
The solution in word would be to save the file as RTF which keeps the
formating.

You could try copying the file to word and then save the File as RTF.

"Joergen Bondesen" wrote:

Hi Joel.

Thanks for your reply.

I think the only real difference is the end of the lines being a
"carriage
return" or "carriage return and line feed".
That is not quite correct. In Denmark we have local letters as æ, ø and å
and therefore I have to change from ANSI to OEM when I am using data in
"old" industrial ink printers.

It is pretty easy to convert a file from one to the other format.

Do you have vba code for both purpose?

--
Best regards from

Jørgen Bondesen


"Joel" skrev i en meddelelse
...
I think the only real difference is the end of the lines being a
"carriage
return" or "carriage return and line feed".

"Chip Pearson" wrote:

If you know ahead of time what the content of the file is, you can
parse
out
some known piece of information and look at the character codes. But
if
you
don't know the content of the file, I don't think you can do what you
want.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Joergen Bondesen" wrote in message
...
Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or
OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character
format.

--
Best regards from
Joergen Bondesen










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default txt-file is in ANSI format or OEM Character format.

Hi Joel.

Another solution if UltraEdit (Hex-editor) supports a scripting language
is
to automatically start the Ultraeditor from excel so the conversion is
automatic.

I will try this solution.

Thanks for your time.

Perhaps, I will be back, later.


--
Best Regards from

Joergen Bondesen


"Joel" skrev i en meddelelse
...
I think there is a simplier solution. Any of the option below can be
converted to a macro if it works.

1) Try saving the file as formatted Text space Delimited.
2) Try printing to a "file" using a OEM Printer or other printer
3) Try copying data to word. Then in word Print to a "file" using
different
Printers.
4) Try 2 and 3 above changing formating to a different Font.

You really have a font problem. You need to get the correct Font that will
work with the printer you are using. I can fix any spacing problems you
may
have with a macro, we just need to get the characters in the file to be
correct.

Another solution if UltraEdit (Hex-editor) supports a scripting language
is
to automatically start the Ultraeditor from excel so the conversion is
automatic.

"Joergen Bondesen" wrote:

Hi Joel.

Thanks for reply.

Regret my insufficient explanation in the beginning.



Today I save the Excel file with customer data to a csv-file.

This file I open in UltraEdit (Hex-editor) and change ANSI to OEM and
close
then file.

This file I deliver to the production ink-printer.

The operator then load the file into then machine. I do think it is some
old
"DOS" because it is not Windows.

Then the operator ink customer data on magazines.



It would be very nice if I could save the Excel-file as an OEM csv-file.



It would also be nice if I could test a csv-file for ANSI/OEM version.


--
Best regards from

Joergen Bondesen


"Joel" skrev i en meddelelse
...
Now I understand the problem. Have you saved the file as CSV file or
other
Text formats. What happens?

to fully understand what is happening you need to save the file and
then
open the file with Notepad or some other text editor. Also try
printing
some
of the text files and see what happends.

The older printers have a smaller character set (number of characters)
it
recognizes. When you use excel or other microsoft products such as
word
you
are using the OEM character set to be compatible with the printer.

You are actually changing the Font and not the word. The font setting
are
invisible formatting characters just like Bold setting or color
settings.
when you save the file as text all the formating characters are
removed.
The solution in word would be to save the file as RTF which keeps the
formating.

You could try copying the file to word and then save the File as RTF.

"Joergen Bondesen" wrote:

Hi Joel.

Thanks for your reply.

I think the only real difference is the end of the lines being a
"carriage
return" or "carriage return and line feed".
That is not quite correct. In Denmark we have local letters as æ, ø
and å
and therefore I have to change from ANSI to OEM when I am using data
in
"old" industrial ink printers.

It is pretty easy to convert a file from one to the other format.

Do you have vba code for both purpose?

--
Best regards from

Jørgen Bondesen


"Joel" skrev i en meddelelse
...
I think the only real difference is the end of the lines being a
"carriage
return" or "carriage return and line feed".

"Chip Pearson" wrote:

If you know ahead of time what the content of the file is, you can
parse
out
some known piece of information and look at the character codes.
But
if
you
don't know the content of the file, I don't think you can do what
you
want.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Joergen Bondesen" wrote in message
...
Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format
or
OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM
Character
format.

--
Best regards from
Joergen Bondesen












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert xls file to ANSI format needhelpnow Excel Discussion (Misc queries) 0 February 23rd 10 04:21 AM
Format .txt file contents to numeric format will not work - help! Tacrier Excel Discussion (Misc queries) 3 October 7th 08 10:00 PM
How do I save a 689 character fixed field/record format file Mike Excel Discussion (Misc queries) 1 July 23rd 08 12:22 AM
how to format a Docmd to pull in an Access file in Text format Campbellj4 Excel Programming 0 November 2nd 05 04:22 PM
how to format a Docmd to pull in an Access file in Text format Campbellj4[_2_] Excel Programming 0 November 2nd 05 04:22 PM


All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"