northernbloke
Programmer
I am having problems with my data files.
They are created elsewhere and contain lines of text between 12 and 3000 characters. These Chars contain escape and special chars (line feed form feed etc).
ie:
e à ¯ï z| “act_mdowe e MANDYDOWEPC e à ¯ï “ з!}e à ¯ï
That is one line. If the line is a small line without special chars - I can cope. I strip out the users name (act_mdowe) If it is a large line or has special chars the perl script exits before all lines in the input file have been processed.
@inp = <FILE>;
foreach $inr (@inp) {
&checkline();
}
sub checkline() {
while ($inr =~ /[a-zA-Z]{3}_[a-zA-Z]{1,}/g) {
print "found $&\n";
@array[$num++] = &uppercase($&);
}
this works happily on pure text files - what am I missing if I want to deal with 'odd' data files.
Any pointers welcomed.
A bloke in need....
They are created elsewhere and contain lines of text between 12 and 3000 characters. These Chars contain escape and special chars (line feed form feed etc).
ie:
e à ¯ï z| “act_mdowe e MANDYDOWEPC e à ¯ï “ з!}e à ¯ï
That is one line. If the line is a small line without special chars - I can cope. I strip out the users name (act_mdowe) If it is a large line or has special chars the perl script exits before all lines in the input file have been processed.
@inp = <FILE>;
foreach $inr (@inp) {
&checkline();
}
sub checkline() {
while ($inr =~ /[a-zA-Z]{3}_[a-zA-Z]{1,}/g) {
print "found $&\n";
@array[$num++] = &uppercase($&);
}
this works happily on pure text files - what am I missing if I want to deal with 'odd' data files.
Any pointers welcomed.
A bloke in need....