On 2011-07-15 17:42, Wagner, David --- Sr Programmer Analyst --- CFS wrote:
I have the following map: map{[$_,(/^\d/ ? 1 : 0) . /^([^;]+)/, /[^;]+;[^;]*;[^;]+;[^;]+;([^;]+);/]} I had a failure during the night because some data field(s) had a semi-colon in the data. So what I have is a pre-defined data separator that would not normally appear in data. What I have selected and have been using is ;'; . I was going to do this, until I got down to this map and I am unsure how to change ([^;]+) or [^;]+ to have ;'; as the separator of my fields.
The easiest way is to pick a single character separator that doesn't occur in your data. For example TAB, or $; which by default is chr(28).
Better yet, use a module that guards the data for you, like Text::CSV. http://search.cpan.org/perldoc?Text::CSV -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/