All I have to say is thank God I don't have to program in perl.....

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Philjpap
Sent: Wednesday, January 09, 2002 4:30 AM
To: [EMAIL PROTECTED]
Subject: RE: Read a file


Shawn,

The following is some PERL code I used to read and cleanup an exported
database file viewed in the HEX mode.

#!/usr/local/bin/perl -w
#
        unless (open(INHANDLE, "lib.csv"))
                                {
                                die ("cannot open input file for reading");
                                }
                                #
        unless (open(OUTHANDLE, ">libout.txt"))
                                {
                                die ("cannot open input file for writing");
                                }
#
#$count = 0;
        while($line = <INHANDLE> )
                {
                                #
                                #
                                #       $CRLF = "\x0D\x0A";
#00 89 00 01 8D
#4E 8C 00 01 8D
#   90 00 01 8D
#   76 00 01 8D
#   7D 00 01 8D
#49 74 00 01 8D
#   92 00 01 8D
#   72 00 01 8D
#   83 00 01 8D
#43 62 00 01 8D
#
        $line =~ s/\"\w*\W*(\W+|\w+)?\x00\x01\x8D/\"\x0D\x0A/g;
        print "$line\n";
        print OUTHANDLE "$line";
        #next ;                                                                        
 #
        #}
        #print "No Match!\n\n";
        #next ;
        #print OUTHANDLE "$line";
                }                               # end WHILE
#
#print "\n\n\t\t\tDONE\n\n";
close INHANDLE;
close OUTHANDLE;

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Shawn Cassedy
Sent: Wednesday, January 09, 2002 12:21 AM
To: [EMAIL PROTECTED]
Subject: RE: Read a file


1. and this is a big one- Use the right tool for the job. CF probably is not
it for reading a file that large. Try compiled code VB, C, Java. All can do
a better job and you may find an .exe that will do what you want if you hunt
around a bit.

2.Look for constants, things you can use as delimiters. Is this some kind of
Word doc? Periods might work. Maybe line feeds or carriage returns? Hard to
say, you need to give us more info.

Just about everything can be done. It's just a matter of picking the right
tools and wanting to do it bad enough.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Bob Gillham
Sent: Tuesday, January 08, 2002 2:23 PM
To: List@Dfwcfug. Org
Subject: Read a file


Anyone know an easy way to read a file in one line at a time.  And
perhaps stop after so many lines.  I have a 120 meg file that I would
like to read a little of.

Thanks in advance.


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to