help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Concatenate files by date


From: Francesco Potortì
Subject: Re: Concatenate files by date
Date: Tue, 14 Jun 2016 17:52:19 +0200

>I have separate text files that consist of a date column followed by columns
>of relevant data and I would like to load them and concatenate them into one
>file that has the date column and then all the relevant data from the
>following columns from the separate files. The date columns will
>occasionally have missing/different dates so I'd like the date columns to be
>merged whilst preserving the correct date stamps for the rows/columns of the
>concatenated data.
>
>A simple example:
>
>File A
>14/06/2016, 1, 2, 3
>16/06/2016, 4, 5, 6
>
>File B
>15/06/2016, 7, 8, 9
>17/06/2016, 10, 11, 12
>
>should be merged to
>
>File C
>14/06/2016, 1, 2, 3
>15/06/2016,  ,  ,  , 7, 8, 9
>16/06/2016,4, 5, 6,  ,  ,  
>17/06/2016,  ,  ,  , 10, 11, 12 
>
>Can this be done in Octave, and if so, what is the Octave syntax?

Yes, this can be done in Octave.  There is no simple syntax that I can
think of.  You should write your small procedure by yourself or maybe
wait for someone here to write it for you :)

I would start with dlmread (easiest), or textread (faster) or scanf
(fastest, use this for big files).  Then I would write out the data with
dlmwrite (easiest) or fprintf (total control).

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it




reply via email to

[Prev in Thread] Current Thread [Next in Thread]