Re: parsing Nero .nri file -- possible character set issues (perl newbie)
From: m (mpepple_at_hotmail.com)
Date: 01/14/04
- Next message: sparkane: "Re: array search speeds?"
- Previous message: ctcgag_at_hotmail.com: "Re: Securing source code"
- In reply to: Simon Taylor: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Next in thread: Jim Gibson: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Reply: Jim Gibson: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Reply: John W. Krahn: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jan 2004 09:07:30 -0800
Simon Taylor <simon@unisolve.com.au> wrote in message news:<bu27iu$4he$1@otis.netspace.net.au>...
> Hello Matt,
>
> > redhat 7.2, perl 5.6.1
> >
> > am trying to extract filenames from Nero .nri file, which has quite a
> > bit of extra, strange characters.
>
> It would help if you could submit a (small) sample of the data you're
> trying to parse, along with the code that you're currently using.
>
> There are a lot of very clever people reading this list, but you have to
> help them as much as you can to increase your chances of getting a
> useful answer.
>
> > anytime i try to open the source .nri file with a perl script, it
> > outputs all sorts of crazy talk and changes my prompt's characters to
> > crazy characters,
>
> Is this really what's happening, or is it more accurate to say that the
> screen corruption occurs when you *display* the contents of the .nri
> file, (and not when you merely open it, as you've implied)?
>
> I hope this helps a little. I look forward to seeing a follow up post
> from you.
>
> Regards,
>
> Simon Taylor
Simon-
Thanks for the response. I tried pasting a portion of the nri file
into this window but it doesn't seem to like that. the whole file is
here: http://mattpepple.com/nero/cg36.zip (6k).
i can pico the nri file, but barely anything displays (maybe 15
characters). i can less the file and it shows all sorts of weirdness,
which i touched on in the original post. none of this has any effect
on the crazy character/screen corruption--that does not occur until i
try to open the file with my perl script.
### begin code sample
open (INFILE, "$curfile") || die "couldn't open $curfile";
open (OUTFILE,">> $destXml") || die "couldn't open $destXml\n";
while ($input = <INFILE>) {
unless ($input =~ /.mp3\s|.ogg\s|.wav\s|.mp4\s|.mp2\s|.wma\s/i)
{next};
$input =~ s/![a-zA-Z0-9-_\s]//;
$filename = substr $input, 60;
foreach $filetype (@filetypes) {
# @filetypes is a list similar to that from line 4: .mp3, .ogg, etc..
$eofname = rindex($input, $filetype);
if ($eofname > 0) {last};
}
$filename = substr($filename, 0, $eofname);
$format = substr($filename,-3,3);
### end code sample
i know line 5 ($input =~ s/![a-zA-Z0-9}//;) doesn't do what i
intended. my thought was to put that in a 'while' control structure
and eliminate any occurrences of non [a-zA-Z0-9\s-_] characters.
other than line 5--which was inserted to handle the nri file's weird
characters--the rest of the script does pretty much what i need it to
when tested against a file i made in pico.
if any more info is needed, jus let me know. i very much appreciate
any help you can offer.
matt
- Next message: sparkane: "Re: array search speeds?"
- Previous message: ctcgag_at_hotmail.com: "Re: Securing source code"
- In reply to: Simon Taylor: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Next in thread: Jim Gibson: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Reply: Jim Gibson: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Reply: John W. Krahn: "Re: parsing Nero .nri file -- possible character set issues (perl newbie)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|