Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: cover more complicated cases

...

Code Block
languagebash
titleCreate a new version of a file with an added constant integer column using command line odb tool
$ odb sql 'select *, int(1) as mf_vertco_type' -i in.odb -o out.odb -f odb

This technique is limited to adding columns with constant values or values that are derived from other columns of the input file and can be expressed as expressions of ODB API SQL. In case we want to populate the added column(s) with some arbitrary values we need to write a program that reads the input file and writes output file with the added columns. This can be done with any of the currently supported languages: Python, C, C++ or Fortran.