This shows you the differences between two versions of the page.
jvs:fscan:manual:chapter2:table [2014/01/24 22:27] voyvodic [Table -- Manipulate data tables] |
jvs:fscan:manual:chapter2:table [2023/02/23 18:43] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | | ||
- | ===== Table -- Manipulate data tables ===== | ||
- | **usage: | ||
- | * **-table [file] TABLENAME [FLAG] FILENAME**\\ | ||
- | * **-table [show]**\\ | ||
- | * **-table [show] TABLENAME [FLAG][FILENAME]**\\ | ||
- | * **-table query TABLENAME [FLAG] NEWNAME COL [VALUE1] [VALUE2]**\\ | ||
- | * **-table delete TABLENAME [FLAG] [COL] [VALUE1] [VALUE2]**\\ | ||
- | * **-table TABLENAME**\\ | ||
- | * **-table [reference] TABLENAME [FLAG] REFNAME**\\ | ||
- | * **-table [glossary] TABLENAME [FLAG] GLOSSARYNAME**\\ | ||
- | * **-table dataset TABLENAME [FLAG]**\\ | ||
- | * **-table window TABLENAME [FLAG]**\\ | ||
- | * **-table directory TBLNAME [FLAG] DIRNAME [MATCHSTRING [TBL2NAME]]**\\ | ||
- | * **-table configure TBLNAME [FLAG] COLNAME [TYPE] [COLNUM] [COLNAME [TYPE] [COLNUM]] ...**\\ | ||
- | * **-table copy TBLNAME [FLAG] NEWNAME [nrows NROWS] ]**\\ | ||
- | * **-table sort TBLNAME FLAG SORTCOL**\\ | ||
- | * **-table merge TBLNAME FLAG TBL2NAME MERGECOL**\\ | ||
- | * **-table printf TBLNAME FLAG FORMATSTR [OUTFILE]**\\ | ||
- | * **-table invivo TBLNAME FLAG NAME**\\ | ||
- | |||
- | The TABLE command is used for loading, querying, and displaying tables. Tables are multi-column data sets where each column can contain either text strings or number values. Tables can be loaded from text files, or by extracting information from different internal data lists (e.g. data set names, window names, reference time course condition names, glossary names). When loading tables, the type of data source can be identified explicitly using the first argument (e.g. file, reference, glossary, dataset, window) or implicitly using the FILENAME/ | ||
- | ====Loading table from file==== | ||
- | With FILENAME and no " | ||
- | |||
- | ====Loading table from a directory==== | ||
- | FLAG (combine by adding):\\ | ||
- | * 1 - include regular files (text and data)\\ | ||
- | * 2 - include directory names\\ | ||
- | * 4 - include filetype\\ | ||
- | * 8 - sort the table\\ | ||
- | * 16 - append new data to existing table\\ | ||
- | DIRNAME: starting path for directory search (default= current dir)\\ | ||
- | MATCHSTRING: | ||
- | TBL2NAME: if present, assumes first column is list of directories; | ||
- | |||
- | ====Loading table from internal data lists==== | ||
- | |||
- | ===Data set names=== | ||
- | The table will contain a list of data sets currently available. | ||
- | |||
- | ===Window names=== | ||
- | The table will contain a list of windows currently open. | ||
- | |||
- | ===Reference=== | ||
- | The table will contain a list of condition labels for the specified reference time course. | ||
- | |||
- | ===Glossary=== | ||
- | The table will contain a list of ROI labels for the specified glossary. | ||
- | |||
- | ====Displaying table data==== | ||
- | The " | ||
- | Show is the default if FILENAME is missing.\\ | ||
- | Show with no TABLENAME prints a list of all tables in memory.\\ | ||
- | Show with TABLENAME prints the specified table.\\ | ||
- | If FILENAME is specified, Show prints the table to file FILENAME.\\ | ||
- | The FLAG argument can specify some printing options.\\ | ||
- | |||
- | Show FLAG (combine by adding):\\ | ||
- | * 1 - show column names\\ | ||
- | * 2 - show column types\\ | ||
- | * 4 - show row numbers\\ | ||
- | * 010 - show table title | ||
- | * 020 - comma separated columns | ||
- | * 040 - tab separated columns | ||
- | * 0100 - only show up to 10 rows of data | ||
- | * 0200 - show no data, only header | ||
- | * 0400 - show row sorting index if available | ||
- | ====Configuring a table==== | ||
- | The CONFIGURE option can be used to re-configure an existing table (or create a new empty table). It is intended for adding column names, adding whole columns, moving existing columns, or removing columns. Columns to be modified are specified as triplets of "name type colnum" | ||
- | |||
- | If column NAME exists it is modified to TYPE and moved, if necessary, to column COLNUM. | ||
- | Otherwise, column NAME of type TYPE is added as COLNUM (COLNUM=0 or omitted, means last column). | ||
- | TYPE can be int, float, or text (default is text). | ||
- | |||
- | ====Printf -- formatted display of table data==== | ||
- | The PRINTF option allows you to specify a format string to print out each table row. | ||
- | The format string uses format conversion codes starting with a ' | ||
- | | ||
- | W (width) and P (precision) are optional number values, indicating the width (in character spaces) and precision (values after the decimal point for numbers) to use in the display. If W is omitted there is no text padding.\\ | ||
- | The ' | ||
- | |||
- | There are 5 other special case conversion strings:\\ | ||
- | | ||
- | **% %** - this will print out as a single ' | ||
- | | ||
- | | ||
- | | ||
- | |||
- | |||
- | All other text characters in the format string will be copied directly to each line of output. | ||
- | |||
- | ====Performing a table query==== | ||
- | Query | ||
- | |||
- | COL can be a column index number (1-NCols) or a column name. | ||
- | |||
- | ROW can be a row index (1-NRows) to select a particular cell within COL, or it can be a value to search for in COL (FLAG 8: find rows NOT matching; FLAG 16: only 1st match is found). | ||
- | |||
- | If searching (FLAG& | ||
- | If not searching, then the single value at COL,ROW will be returned if ROW is specified, or the whole column will be returned if ROW is omitted. | ||
- | |||
- | FLAG:\\ | ||
- | * 1 - store into uservarb NEWNAME\\ | ||
- | * 2 - store into table NEWNAME\\ | ||
- | * 4 - search for value ROW in COL (assumed if ROW is not a number)\\ | ||
- | * 8 - find rows where value in COL is **not** ROW\\ | ||
- | * 16 - only return the first match\\ | ||
- | * 32 - don't display error message on query failure\\ | ||
- | |||
- | ====Sorting a table==== | ||
- | Sort FLAG:\\ | ||
- | * 1 - Numerical sort\\ | ||
- | * 2 - Descending order\\ | ||
- | |||
- | ====Special case tables==== | ||
- | * [[jvs: | ||
- | |||
- | **See Also:**\\ | ||
- | [[jvs: | ||
- | |||
- | [[jvs: | ||
- | [[jvs: | ||
- | [[jvs: | ||
- | [[jvs: |