Matthew Margolis <mrmargolis / wisc.edu> writes:

> I currently have a large text file based  address book(for myself, not 
> spamming)  that  I am working on making suitable for import into a 
> database.  To do this I need comma separated values.  How would I go 
> about adding a comma after the state in the person's mailing address?
>
> An example record:
> 
> Name:  Bob Fakeyhead
> Title:  Old Boss
> Phone:  555-555-5555
> Mailing:  23456 Something Street
> OldPlace, WA 55555
>


If you are using Ruby 1.8, you can use the CSV module.

http://www.ruby-doc.org/stdlib/libdoc/csv/rdoc/



::::::::::::::
z.rb
::::::::::::::
#
#  z.rb
# 
#  Copyright (c) 2004 by Daniel Kelley
# 
# 

require 'csv'

writer = CSV.generate('csvfile.csv')
writer << ['Name', 'Title', 'Phone', 'Mailing']
writer << ['Bob Fakeyhead', 'Old Boss', '555-555-5555', '23456 Something Street 
OldPlace, WA 55555']
writer.close

::::::::::::::
csvfile.csv
::::::::::::::
Name,Title,Phone,Mailing
Bob Fakeyhead,Old Boss,555-555-5555,"23456 Something Street OldPlace, WA 55555"

-- 
Daniel Kelley - San Jose, CA
For email, replace the first dot in the domain with an at.