I apologize if this question has been asked before. In spite of its very basic nature I could not find any answer to the following problem on the cadence forums.
From a previous simulation I have a CSV textfile with time/value pairs
0.00000000000e+00 -1.10875637805e+002.00000000000e-13 -1.10875643662e+00....
and the following skill code is used to import it:
pFILE=infile("input.csv")if( pFILE then lDATA=list() time=0 value=0 while(gets( tLINE pFILE) time=substring(tLINE 1 17) value=substring(tLINE 19 18) lDATA=cons(list(time value) lDATA) ) wDATA=artListToWaveform(lDATA) newWindow() plot(wDATA))close(pFILE)
Unfortunately my input.csv is pretty large (300K lines) and artListToWaveform(lDATA) crashes with a stack overflow. Moreover, the import itself is not as fast as I'd like it to be, but this is probably due to the substring function
Is there a more efficieny way for importing large csv files? Thank you in advance.
I've just came across getAsciiWave() which is much faster than my handmade solution, and, even more importantly, it does not crash at 300K lines.
... I knew there must be a simple solution ;-)