Re: Read several files into one big data array? [message #89523 is a reply to message #89519] |
Thu, 23 October 2014 00:46  |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den torsdagen den 23:e oktober 2014 kl. 01:31:12 UTC+2 skrev luc...@gmail.com:
> On Wednesday, October 22, 2014 4:05:43 PM UTC-7, Craig Markwardt wrote:
>> On Wednesday, October 22, 2014 4:57:12 PM UTC-4, luc...@gmail.com wrote:
>>> I have tons of data files in the same folder. They are named correctly with the last 5 digits representing the order
>> ...
>>> data = FLTARR(nlines)
>>
>> Don't you want a more complex data type there? You are reading at least four numbers (integer, time, two floating point), so either it should be FLTARR(4,nlines), or a structure.
>>
>> Craig
>
> Yes! Craig, thank for catching that!
>
> I was getting only the first column
If you are just reading those files in order to put the contents in another file, why bother parsing the lines and putting them in an array?
It should be enough to just read each line as a string, add the file number to the beginning of that string, and then write it to the output file.
|
|
|