Re: using sed to add text to csv file

Joel Hammer <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <1336175672.1984.4.camel@hammer11>
This works for me.
(I cheated and used vim and sed to create this script. It took about 5
minutes.)


#!/bin/bash
sed -n "
/^First/b
s/^/firstname=/
s/,/\&lastname=/
s/,/\&address=/
s/,/\&city=/
s/,/\&st=/
s/,/\&zip=/
s/,/\&email=/
s/,/\&phone=/
s/,/\&dob=/
s/,/\&optindate=/
s/,/\&ipaddress=/
s/,/\&url=/
p
" yourfile.csv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.