From: Roland G. <RGi...@cp...> - 2006-03-13 11:46:32
|
Hi Kevin, I don't see what this has to do with Expect, but I'm in a generous mood today... :o) Your script is working just fine, a .doc (which is probably a Word-document) is a binary format with lots of strange characters in it. Hope this helps, Roland Quoting manofwax <man...@ho...>: > > Hello, > > I'm trying to write a script so that it can search through some > specific > item from all of the files in one directory. I'm able to do this only > if these files are regular text file without any format. However, when I > ran my > script on some .doc file with tables, special characters, and some > content which has restriction on copy and paste, my script failed. > > I think my script couldn't read in these special character correctly. > This is how I read the file: > > open(INFILE, $fName) || die("Could not open file!"); > @junk =3D <INFILE>; > close(INFILE); > > I tried to see what my script read by outputing the @junk to a file, > I got > something like this: > > =C3=90=C3=8F=11=C3=A0=C2=A1=C2=B1=1A=C3=A1 > =03 > =C3=BE=C3= > =BF=09 =06 =01 =11=19 4=0C =20 > z=02 =14 =C2=90=C5=93=C3=BBp=C3=A3 =C3=85=012=01 2=01 > =E2=80= > =98=12 =1C:=07=13 FORMTEXT =01=143/4/05=15=07REV:=07=13 FORMTEXT=07 > > Do you know how I can read this file correctly?? Thanks a lot. > > Kevin > > -- > View this message in context: > http://www.nabble.com/How-to-read-a-file-with= > -special-format-and-character-t1260855.html#a3345144 > Sent from the Perl - Expectperl-Discuss forum at Nabble.com. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > -- RGi...@cp... |