N
norfernuman
I am trying to remove carriage returns ( and more ) from each element of an array before
using them to create a record for a text file. Somehow I sill keep missing
one once in a while and a carriage return occurs in the middle of an order record.
Here is what I'm doing now.
-------------
open(FILE, ">$dump_file") or die("Couldn't open $dump_file for writing: $!");
while (@ary = $sth->fetchrow_array ()) {
for (@ary) {
s/\t+//g;
s/\r+|\n+//g;
}
print FILE (join ("\t", @ary), "\r\n");
}
close (FILE);
using them to create a record for a text file. Somehow I sill keep missing
one once in a while and a carriage return occurs in the middle of an order record.
Here is what I'm doing now.
-------------
open(FILE, ">$dump_file") or die("Couldn't open $dump_file for writing: $!");
while (@ary = $sth->fetchrow_array ()) {
for (@ary) {
s/\t+//g;
s/\r+|\n+//g;
}
print FILE (join ("\t", @ary), "\r\n");
}
close (FILE);