Gossamer Forum
Home : Products : DBMan : Customization :

Replace carriage return characters

Quote Reply
Replace carriage return characters
Hi,
I'm have problem in removing the "carrige returns" before displaying. What I have is a number of textarea in my DB where user press the "Enter" or "Return" key and from what I can see when the request is submitted the record looks like this in the DB file
1|Test1````|Test2````|test3````|comments|
2|Test1````|Test2````|test3````|comments|
.
.
5|Test1````|Test2````|test3````|comments|

Q1. Are these ```` the carriage returns.?

Q2. If so why can't I search and change these ```` to . or a space. Here is the code I'm using to no avail.
open (DB, "<$db_file_name") or &cgierr("error in count. unable to open database: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB,1); }
@lines = <DB>;
close DB;
foreach $line (@lines) {
chomp ($line);
@data = &split_decode($line);
++$count{$data[8]};
++$total_count;
}

then I'm doing
foreach $line (@lines) {
chomp ($line);
@data = &split_decode($line);
if ($data[13] eq "Waiting" && $data[19] eq "Open") {
$data[1] =~ s/``/./g;
print qq|
.
.
|;
}
}

I can't seem to replace the ```` with . or a space.

Thanks in advance for any help or advise on what I'm doing wrong.
Subject Author Views Date
Thread Replace carriage return characters cwilcox 2384 Mar 28, 2006, 8:15 PM
Post Re: [cwilcox] Replace carriage return characters
JPDeni 2298 Mar 28, 2006, 9:26 PM