Thanks a lot. Brilliant little trick. However it only
does it for the first row of the data. So I just had
to execute the script over and over again until it
parsed the entire data set.
Btw, where do you learn these things from? I'm not a
computer science major, so are there any quick intro's
to perl?
thanks, james.
--- Derek Fountain
Does anyone know of a (command line) program in SuSE that allows you to replace all occurences of a certain string in a text (CSV) file with another?
I have a (huge) file which contains Matlab style 'NaN' for missing data and I need to make it Gauss readable by replacing all the 'NaN' with the symbol '.'. It's too big to be loaded into an editor or excel etc.
Using everyone's favourite swiss army chainsaw:
perl -pi -e 's/NaN/\./' file.csv
Take a backup first!
--
eatapple core dump
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com