gnuastro-devel
[Top][All Lists]
Advanced

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

[task #15317] Concatenate two or more tables by row


From: Amey Varhade
Subject: [task #15317] Concatenate two or more tables by row
Date: Sun, 4 Apr 2021 11:23:14 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36

Follow-up Comment #40, task #15317 (project gnuastro):

I have gone through the discussion on concatenating tables by columns and have
got a basic understanding of the code and file structure.
I have started working on this, but I am stuck here


   /* Append a counter to the column names because this option is most
         often used with columns that have a similar name and it would help
         the user if the output doesn't have multiple columns with same
         name. */
      if(p->catcolumnrawname==0)
        for(newcol=tocat; newcol!=NULL; newcol=newcol->next)
          if(newcol->name)
            {
              /* Add the counter suffix to the column name. */
              sprintf(cstr, "-%zu", counter);
              tmpname=gal_checkset_malloc_cat(newcol->name, cstr);

              /* Free the old name and put in the new one. */
              free(newcol->name);
              newcol->name=tmpname;
            }

      /* Find the final column of the main table and add this table.*/
      final=gal_list_data_last(p->table);
      final->next=tocat;
      ++counter;


Here, the tables are stored as lists of gal_data_t structs, how to access rows
to add the rows.
I am not able to understand how to access the values in a column row-wise.
Apart from this most other changes would remain the same. I didn't find
relevant reading material, in the library demo program as well, the table was
read coulmnwise, the column metadata of first file will be used later, so how
should the lists be combined ?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?15317>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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