Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Sub Help - dealing with hyphens

Expand Messages
  • merlyn@stonehenge.com
    ... campbell262 I have a record: campbell262 123-456,RTY,76-78,12-09-87,key campbell262 I would like to remove the hyphens from the first, and fourth values
    Message 1 of 2 , Aug 12, 2010
    • 0 Attachment
      >>>>> "campbell262" == campbell262 <campbell262@...> writes:

      campbell262> I have a record:
      campbell262> 123-456,RTY,76-78,12-09-87,key

      campbell262> I would like to remove the hyphens from the first, and fourth values as delimited by commas but not the third value. So I would like to have the record look like this:


      campbell262> 123456,RTY,76-78,120987,key

      campbell262> Can I do this using a Perl regular expression?

      Best would be to use a CSV parser, and just do the substitution
      on the useful fields.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
      See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
    Your message has been successfully submitted and would be delivered to recipients shortly.