replace hard return followed by a tab



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?
.



Relevant Pages

  • Re: Solving the lib mismatch problem
    ... This section is pointed to by an entry in the section table with the ... The number of entries in the table is determined by DT_VERDEFNUM. ... This is an index into the string section referenced in the section ... Offset in the string section reference by the link in the section ...
    (comp.unix.programmer)
  • Re: replace hard return followed by a tab
    ... In the first column there is either a string or ... in the second column there is a string. ... foreach $entry { ... Replace the body of the loop with: ...
    (comp.lang.perl.misc)
  • Re: Matrix Permutation
    ... like to generate 1 string of numbers for the first column. ... procedure that, given any entry, can quickly find the "next" entry. ... The simple iterative procedure is sometimes referred to as "odometer" code. ...
    (comp.soft-sys.matlab)
  • Re: replace hard return followed by a tab
    ... In the first column there is either a string or ... in the second column there is a string. ... foreach $entry { ... Replace the body of the loop with: ...
    (comp.lang.perl.misc)
  • Re: Matrix Permutation
    ... like to generate 1 string of numbers for the first column. ... procedure that, given any entry, can quickly find the "next" entry. ... The simple iterative procedure is sometimes referred to as "odometer" code. ...
    (comp.soft-sys.matlab)