Page 1 of 1 1
Topic Options
#9727 - 2001-06-19 07:38 PM Reading Unicode .txt -- vs.-- ANSI .txt
Anonymous
Unregistered


Hello all -

I'm trying to read a .txt file created via "winmsd /report xxxxxx" command (on a W2K client). However, each line read
contains only a single character (yet when I view the file via notepad, etc., each line displays as it should). What
I have found is that the file created by WINMSD is encoded as Unicode. If I (via notepad) save it back out as ANSI,
each record is then read in properly! Does anyone have ideas as to how I can get around this issue? Here's the script:

code:
___________________________________________________________________

SHELL "%comspec% /c winmsd /categories +ResourcesIRQS /report c:\IRQS.txt
SLEEP 5 ; give time for winmsd to finish
OPEN(1,"IRQS.txt")
WHILE @ERROR = 0
$x = READLINE(1)
? $x
LOOP
SLEEP 5 ; let me see the contents
CLOSE(1)
____________________________________________________________________

TIA !

- Michael

Top
#9728 - 2001-06-19 08:10 PM Re: Reading Unicode .txt -- vs.-- ANSI .txt
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hey Micheal,

The only thing (I) can think of quickly is to filter it through a good olde dos command that can read it wide on the front-end and pump it out ANSI on the back-end, like maybe the "TYPE" command, try this ...

SHELL "%comspec% /c winmsd /categories +ResourcesIRQS /report c:\IRQS.txt
SHELL "%comspec% /c type c:\IRQS.txt >c:\IRQSANSI.TXT"
OPEN(1,"C:\IRQSANSI.txt")
...

Luck,

-Shawn

Top
#9729 - 2001-06-19 08:32 PM Re: Reading Unicode .txt -- vs.-- ANSI .txt
Anonymous
Unregistered


Thanks Shawn -

That did the trick

- Michael

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.05 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org