So, recently, I wrote a nice little perl script to go through a
moderately large file (about 400 Meg fixed record length file of rows
that are 1870 characters wide). It runs quite fast; provides
accurate results and I'm happy with it.
My employer doesn't want to use it because it's in perl and he
doesn't think that anyone else in the building knows perl. So, I
decided to work on my java syntax (recently started doing a bit of
java) and use java in order to manipulate the file instead.
My perl script basically does 2 things:
1. selects rows that have .{51}055 in them.
2. based on those selected rows, pull out just a few different
tagged locations as the appropriate data fields. (the file is a VSAM
record and has a ton of valueless crap in it that we don't want.
I've basically rewritten the thing w/ a simple POJO; I'm not using
regex within java because I'm impatient & didn't feel like reading
all of the api documentation on the different objects for using regex
(but I will eventually). In any event, I found that I didn't need
regex in java because I could use a substring command instead.
It is significantly less efficient than the perl script. So my
questions are:
1. Is the java significantly slower than the perl script because I
suck at writing efficient java code or because perl is just really
that much better at string manipulation?
and
2. Does anyone know if the java would be significantly improved if I
make use of regex instead of using substring functions?
thanks in advance,
Jen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/