Re: [R] CSV format issues

2012-07-24 Thread Guillaume Meurice
Dear all thanks for support. I'll set up an heuristic so as to catch most of the case. For the handful of ambiguous case, I'll exclude them from analysis, with a feedback to the software editor so as he can correct the format of the csv file. Bests, -- Guillaume Le Jul 23, 2012 à 4:54 PM, p

Re: [R] CSV format issues

2012-07-23 Thread peter dalgaard
On Jul 23, 2012, at 15:06 , Guillaume Meurice wrote: > Dear all, > > I have some encoding problem which I'm not familiar with. > Here is the case : > I'm read data files which can have been generated from a computer either > with global settings in french or in english. > > Here is an exemp

Re: [R] CSV format issues

2012-07-23 Thread Duncan Murdoch
On 23/07/2012 9:06 AM, Guillaume Meurice wrote: Dear all, I have some encoding problem which I'm not familiar with. Here is the case : I'm read data files which can have been generated from a computer either with global settings in french or in english. Here is an exemple ouf data file : * E

Re: [R] CSV format issues

2012-07-23 Thread jim holtman
try this; looks for strings of numbers with commas and quotes them: > x <- readLines(textConnection("Time,Value + 32,-7,183246E-02 + 32,05,3,469364E-02")) > # process the data putting in quotes on scientific > x.new1 <- gsub("(-?[0-9]+,[0-9]+E-?[0-9]+)", '"\\1"', x) > x.new1 [1] "Time,Value"