join two .csv files [message #86960] |
Tue, 17 December 2013 03:06 |
capercas
Messages: 4 Registered: November 2013
|
Junior Member |
|
|
Hi all,
I have this problem due to the procedure called "write_csv" does not allow me to include more than 8 data. The code is the following:
----WRITE_CSV.PRO----------------------------
function write_csv_convert, data
compile_opt idl2, hidden
switch (SIZE(data, /TYPE)) of
7: begin ; string type
; Always surround all strings with quotes, to avoid problems with
; commas and whitespace.
data1 = '"'+data+'"'
; Now look for double-quote chars, which need to be escaped.
hasQuote = WHERE(STRPOS(data, '"') ge 0, nQuote)
if (nQuote gt 0) then begin
d = data[hasQuote]
for i=0,nQuote-1 do d[i] = STRJOIN(STRTOK(d[i],'"',/EXTRACT),'""')
data1[hasQuote] = '"' + d + '"'
endif
return, data1
end
6: ; complex and dcomplex (fall thru)
9: return, '"' + STRCOMPRESS(data, /REMOVE_ALL) + '"'
else: begin
; regular numeric types
return, STRTRIM(data, 2)
end
endswitch
end
---------------------------------------------------
First of all I would like to know if I can change the limitation of data that can be read (honestly, I do not how to do it)
In my main procedure what I want to do is join the outputs of this procedure which are .csv files (csv_file1, csv_file2, csv_file2). Is there anyway to join this three .csv files obtaining just one with all the data (per columns)?
Thank you very much,
Carolina
|
|
|