bestresearch2 has asked for the wisdom of the Perl Monks concerning the following question:
I am reading in a tab delimited text file exported from Excel. Some fields have begin and end with quotation marks because the fields themselves have non-printable characters including tabs. How do I do search/replace for just the tabs inside of strings bounded by quotation marks?
In the following example, I'd like to remove the two tabs next to field3:
$inputstring="field1\tfield2\t\"field3\t\t\"\tfield4\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remove tabs only between quotation marks
by Fletch (Bishop) on Apr 12, 2011 at 14:38 UTC | |
|
Re: Remove tabs only between quotation marks
by kennethk (Abbot) on Apr 12, 2011 at 15:01 UTC | |
|
Re: Remove tabs only between quotation marks
by AnomalousMonk (Archbishop) on Apr 12, 2011 at 19:50 UTC | |
|
Re: Remove tabs only between quotation marks
by jethro (Monsignor) on Apr 12, 2011 at 14:38 UTC | |
|
Re: Remove tabs only between quotation marks
by JavaFan (Canon) on Apr 12, 2011 at 16:27 UTC | |
|
Re: Remove tabs only between quotation marks
by wind (Priest) on Apr 14, 2011 at 23:01 UTC | |
|
Re: Remove tabs only between quotation marks
by locked_user sundialsvc4 (Abbot) on Apr 12, 2011 at 15:53 UTC | |
by BrowserUk (Patriarch) on Apr 12, 2011 at 15:54 UTC |