I was wondering if anyone could point me in the right direction for
solving the following problem:
I am appending to a csv every time a database change is made in a Rails
app I am working on.
I would like to join the rows together based on the first field.
If this field has duplicates, I would like to combine all values in each
row into one row.
Each row will have only one updated field.
All other fields will be denoted with an asterisk.
The following is an example:
100000000,myemail@ischanged.com,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*
100000000,*,*,888-888-8888,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*
100000000,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,My Company was
changed,*,*,*,*,*
100000000,*,*,*,*,*,*,*,*,*,*,*,303 changed work
address,*,*,*,*,*,*,*,*,*,*
I need the above to look like the following:
100000000,myemail@ischanged.com,*,888-888-8888,*,*,*,*,*,*,*,*,*,303
changed work address,*,*,*,*,My Company was changed,*,*,*,*,*
Any help would be appreciated.
Thanks,
Kris Windham
···
--
Posted via http://www.ruby-forum.com/.