F
Francois Massion
I have a list of entries in a table which is available as a tab-
separated text. In the first column there is either a string or
nothing, in the second column there is a string.
It looks like this:
Category [Tab] Architecture [Hard return]
[Tab] Technology [Hard return]
[Tab] Medicine [Hard return)
What I want to achieve is:
Category [Tab] Architexture; Technology; Medicine [Hard return]
Here my code:
@entry = <DATA>;
foreach $entry (@entry) {
chomp $entry;
$entry=~ s/(\r|\n){1,}\t/; /mg;
print "$entry\n" ;
}
I have tried different modifiers and more simple replacements like s/\n
\t/; /g;, but to no avail.
Any suggestion?
separated text. In the first column there is either a string or
nothing, in the second column there is a string.
It looks like this:
Category [Tab] Architecture [Hard return]
[Tab] Technology [Hard return]
[Tab] Medicine [Hard return)
What I want to achieve is:
Category [Tab] Architexture; Technology; Medicine [Hard return]
Here my code:
@entry = <DATA>;
foreach $entry (@entry) {
chomp $entry;
$entry=~ s/(\r|\n){1,}\t/; /mg;
print "$entry\n" ;
}
I have tried different modifiers and more simple replacements like s/\n
\t/; /g;, but to no avail.
Any suggestion?