# Re: CSV::IllegalFormatError (Need to club data entry person)

**URL:** <https://www.ruby-forum.com/t/re-csv-illegalformaterror-need-to-club-data-entry-person/97718>\
**Category:** Ruby\
**Created:** [July 10, 2006, 12:41am UTC](https://www.ruby-forum.com/t/re-csv-illegalformaterror-need-to-club-data-entry-person/97718 "2006-07-10T00:41:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 10, 2006, 12:41am UTC](https://www.ruby-forum.com/t/re-csv-illegalformaterror-need-to-club-data-entry-person/97718/1 "2006-07-10T00:41:27Z")

</div>

Can you use this:

line = ““NAME”,“610 “A” STREET”,“STATE”,“POSTAL\_CODE””  
regexp=/(?=[^,])"|"(?=[^,])/ # (?= is for maintaining the character  
that is  
not a comma)  
a=line.gsub(regexp,’\1’+"’"+’\2’) # \1, \2 are the first and second  
matches  
in brackets  
regexp=/’([A-Z])’/ # if the address is “610 A street”  
b=a.gsub(regexp,’"’+’\1’+’"’)

p line  
p a  
p b

Best regards,

Axel
