I am trying to split up a field that contains a client matter number. This number is joined together by a period like this 999999.99999 with 6 numbers to the left of the '.' and 5 to the right. I am trying to:
1. splice the field from an array of strings //field #8
2. split the client/matter#
3. join the client/matter# with a comma
4. pushing it back onto the array
I'm not convinced that this is the best method but I haven't had any luck using a loop with string matching. If you have any suggestions I would really appreciate it.
FYI -- The data is coming out of an ASCII file and being written back to another ASCII file.
Also, what is the simplest way to write out a file?
Here's my code:
use strict;
open(DAT,"newPBX_DATA.TXT"
|| die("Cannot Open File!"
;
while (<DAT>)
{
chomp;
my @val = split (/,/, $_, 10000);
$climat = splice(@val, 8, 1);
#remove clientmatter from list and
#store it in $climat
$temp = split(/./, $climat, 50);
$new = join(',', $temp[0], $temp[1]);
push($new);
print join (",", @val) . "\n"; # print out.
}
close(DAT);
exit (0);
1. splice the field from an array of strings //field #8
2. split the client/matter#
3. join the client/matter# with a comma
4. pushing it back onto the array
I'm not convinced that this is the best method but I haven't had any luck using a loop with string matching. If you have any suggestions I would really appreciate it.
FYI -- The data is coming out of an ASCII file and being written back to another ASCII file.
Also, what is the simplest way to write out a file?
Here's my code:
use strict;
open(DAT,"newPBX_DATA.TXT"
while (<DAT>)
{
chomp;
my @val = split (/,/, $_, 10000);
$climat = splice(@val, 8, 1);
#remove clientmatter from list and
#store it in $climat
$temp = split(/./, $climat, 50);
$new = join(',', $temp[0], $temp[1]);
push($new);
print join (",", @val) . "\n"; # print out.
}
close(DAT);
exit (0);