Ask a Question related to PERL Miscellaneous, Design and Development.
-
M Pires #1
Pattern Matching in file with invisible char
Hi there,
First of all, I am sorry if this is a FAQ. I couldn't find anything in the
PerlDoc, so if I missed something please be kind enough to redirect me to
it!
I am currently working on a Perl script that will parse out values from an
"almost" text file. The reason I say this is because there are "invisible"
chars in the file such as the ASCII SUB char ( 0x1A ). This chars confuse
the <HANDLE> and cause a premature EOF.
Is there a way around this?
Thx a lot!
M Pires Guest
-
file path pattern matching problem.
Hi all, I'm trying to split apart a filepath...e.g: c:\test\abc\what\somefile.txt The length of the filepath will never be constant... e.g:... -
pattern matching
brian liu <xliu75@yahoo.com> wrote: or $defaultDir='d:/haha'; or -
Pattern Matching Operators
Is there a similar operator in Perl for ${variable##pattern} as there is in korn shell. Thanks for the help. Prasad ... -
[PHP] mysql Pattern Matching
From: "Ralph Guzman" <ralph213@sbcglobal.net> Actually no, I guess there isn't. Neither one will use an index. mysql> desc test;... -
mysql Pattern Matching
i'm doin this offlist -----Original Message----- From: Ralph Guzman Sent: Thursday, September 04, 2003 10:23 PM To: PHP General Mailing List... -
Tad McClellan #2
Re: Pattern Matching in file with invisible char
M Pires <MIGUEL.PIRES@PORTUGALMAIL.PT> wrote:
> I am currently working on a Perl script that will parse out values from an
> "almost" text file.
Then it is a binary file.
> The reason I say this is because there are "invisible"
> chars in the file such as the ASCII SUB char ( 0x1A ). This chars confuse
> the <HANDLE> and cause a premature EOF.
Since we are concerned with files, it might be helpful to know what
OS is being used, as the operating system is what manages the filesystem.
> Is there a way around this?
perldoc -f binmode
--
Tad McClellan SGML consulting
[email]tadmc@augustmail.com[/email] Perl programming
Fort Worth, Texas
Tad McClellan Guest
-
M Pires #3
Re: Pattern Matching in file with invisible char
[email]tadmc@augustmail.com[/email] (Tad McClellan) wrote in message news:<slrnbmectb.4jq.tadmc@magna.augustmail.com>.. .
Thank you very much! For reference the OS is W2K but your tip worked>> > Is there a way around this?
>
> perldoc -f binmode
like a charm. It's frustrating when the answer was in front of you all
along...!
M Pires Guest
-
Tad McClellan #4
Re: Pattern Matching in file with invisible char
M Pires <MIGUEL.PIRES@PORTUGALMAIL.PT> wrote:
> [email]tadmc@augustmail.com[/email] (Tad McClellan) wrote in message news:<slrnbmectb.4jq.tadmc@magna.augustmail.com>.. .
>>>>>> > Is there a way around this?
>>
>> perldoc -f binmode
> Thank you very much! For reference the OS is W2K but your tip worked
> like a charm. It's frustrating when the answer was in front of you all
> along...!
Often, all it takes is trying a bunch of different search terms.
perldoc -q binary
would have done it for you in this case...
--
Tad McClellan SGML consulting
[email]tadmc@augustmail.com[/email] Perl programming
Fort Worth, Texas
Tad McClellan Guest
-
Bart Lateur #5
Re: Pattern Matching in file with invisible char
M Pires wrote:
It's not quite premature... On ancient systems (think DOS and earlier)>I am currently working on a Perl script that will parse out values from an
>"almost" text file. The reason I say this is because there are "invisible"
>chars in the file such as the ASCII SUB char ( 0x1A ). This chars confuse
>the <HANDLE> and cause a premature EOF.
this was used as a end-of-file marker on text files. That's why
binmode() fixes this.
Don't forget you'll now have to delete unnecessary CR characters (=
"\r") yourself.
--
Bart.
Bart Lateur Guest



Reply With Quote

