comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » join two .csv files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
join two .csv files [message #86960] Tue, 17 December 2013 03:06
capercas is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Add a new variable to netCDF file?
Next Topic: PNG output quality degraded after RHEL6 patch

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:13:57 PDT 2025

Total time taken to generate the page: 0.00451 seconds