Gossamer Forum
Home : General : Perl Programming :

problem with colon as delimiter

Quote Reply
problem with colon as delimiter
most of my tables use pipe | as delimiter but one uses colon :

this is the code that creates array from a record:

Code:
sub split_decode {

# --------------------------------------------------------
# Takes one line of the database as input and returns an
# array of all the values. It replaces special mark up that
# join_encode makes such as replacing the '``' symbol with a
# newline and the '~~' symbol with a database delimeter.


my ($input) = shift;
$input =~ s/\Q$db_delim\E$/$db_delim /o; # Add a space if we have delimiter new line.
my (@array) = split (/\Q$db_delim\E/o, $input);
for ($i = 0; $i <= $#array; $i++) {
$array[$i] =~ s/~~/$db_delim/og; # Retrieve Delimiter..
$array[$i] =~ s/``/\n/g; # Change '' back to newlines..
$array[$i] =~ s/&/&amp;/g; # encode ampersand 02/01/2017
}
return @array;
}



it works fine when $db_delim = '|' but can't find an individual record when $db_delim = ':'
Subject Author Views Date
Thread; hot thread problem with colon as delimiter delicia 9948 May 7, 2020, 1:33 PM
Post; hot thread Re: [delicia] problem with colon as delimiter
delicia 9787 May 7, 2020, 1:36 PM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 9783 May 7, 2020, 11:33 PM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 9781 May 8, 2020, 5:43 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 9771 May 8, 2020, 5:52 AM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 9772 May 8, 2020, 5:59 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
delicia 9767 May 8, 2020, 6:10 AM
Post; hot thread Re: [delicia] problem with colon as delimiter
Andy 9760 May 8, 2020, 6:18 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 9756 May 8, 2020, 6:45 AM
Post; hot thread Re: [Andy] problem with colon as delimiter
delicia 9748 May 8, 2020, 7:05 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 9752 May 8, 2020, 6:48 AM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 9748 May 8, 2020, 7:06 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 9741 May 8, 2020, 7:27 AM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 9739 May 8, 2020, 7:34 AM
Post; hot thread Re: [delicia] problem with colon as delimiter
Andy 9709 May 8, 2020, 10:49 PM