Trouble with special characters in batch and exporting to file
I am trying to export
<EriFile VersionNumber="1357" NumberOfEriEntries="1" EriFileType="1">
<CallPromptId Id="0" CallPromptText="CallPromptId0"/>
<CallPromptId Id="1" CallPromptText="CallPromptId1"/>
<CallPromptId Id="2" CallPromptText="CallPromptId2"/>
<EriInfo RoamingIndicator="128" IconIndex="1" IconMode="0" EriText="%CARRIERVAR" CallPromptId="0" AlertId="0"/>
</EriFile>
to a .txt
via a batch file
Using echo text >.file.txt
I tried using an escape character (^) before every special character, and then every single character! But still didnt' work, any idea how to get this done?
July 21st, 2010 11:24pm
Hi,
Actually, TXT file supports special characters, but it doesn’t support to be viewed. You may choose Notepad++, a free tool to view details.
If you want to read special characters as “^A”,”^B”, it’s not easy for BAT file to create it. However, you may use script
to do it. I would like to offer an pseudo code below:
(^(char((asc
X)+64)))
Case: if you want to display control characters 12, which can be recorded as ^L. Then:
(^(char((asc
X)+64)))= (^(char((12)+64)))= (^(char(76))=^L
For your information, please refer to the following link. It’s only for read.
http://www.robelle.com/smugbook/ascii.html
For further assistance, you may refer to
MSDN Forum, which can provide you more information related coding. In this way, your issue can be addressed effectively.
Regards,
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2010 12:43pm