This shows you the differences between two versions of the page.
jvs:fscan:manual:chapter2:table [2015/05/04 20:02] voyvodic |
jvs:fscan:manual:chapter2:table [2023/02/23 18:43] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | | ||
- | ===== Table -- Manipulate data tables ===== | ||
- | **usage: | ||
- | * **-table [show]**\\ | ||
- | * **-table TABLENAME**\\ | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | * **[[jvs: | ||
- | |||
- | 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 - replace missing values with ' | ||
- | * 0400 - show no data, only header | ||
- | * 01000 - 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==== | ||
- | | ||
- | |||
- | NEWNAME is where to store the results if FLAG & 3, or if NEWNAME is not a column name in TBLNAME. | ||
- | |||
- | COL can be a column index number (1-NCols) or a column name. | ||
- | (To find column index from column name, use FLAG 16.) | ||
- | |||
- | VALUE1 is the value to search for in COL, or if FLAG&4 VALUE1 is the index number (1-NRows) of the row to return. Note: you can also find the value for a single table cell using the syntax " | ||
- | If VALUE1 is omitted and !FLAG& | ||
- | |||
- | VALUE2: if FLAG& | ||
- | |||
- | FLAG: Option flags (combine by adding):\\ | ||
- | * 1 - store into uservarb NEWNAME\\ | ||
- | * 2 - store into table NEWNAME\\ | ||
- | * 4 - VALUE1 is a row number\\ | ||
- | * 8 - only return row number(s)\\ | ||
- | * 16 - only return column number\\ | ||
- | * 32 - only find first instance\\ | ||
- | * 64 - VALUE2 is a binary mask to use for COL value\\ | ||
- | * 128 - inverse query; search for COL values that don't match; this is automatic if VALUE1 is preceded by ' | ||
- | * 256 - don't display error message on query failure\\ | ||
- | * 512 - find COL with missing value (assumed if VALUE1 = ' | ||
- | * 1024 - do not convert ' | ||
- | ====Deleting a table or table entries==== | ||
- | | ||
- | |||
- | If TBLNAME is the only argument, the entire table will be deleted. | ||
- | |||
- | With other arguments this will perform a QUERY as described above and only delete those rows that satisfy the query. | ||
- | |||
- | FLAG: Option flags (combine by adding):\\ | ||
- | * 4 - VALUE1 is a row number\\ | ||
- | * 32 - only delete first instance\\ | ||
- | * 64 - VALUE2 is a binary mask to use for COL value\\ | ||
- | * 128 - inverse query; search for COL values that don't match; this is automatic if VALUE1 is preceded by ' | ||
- | * 256 - don't display error message on query failure\\ | ||
- | * 512 - find COL with missing value (assumed if VALUE1 = ' | ||
- | * 1024 - do not convert ' | ||
- | ====Sorting a table==== | ||
- | Sort FLAG:\\ | ||
- | * 1 - Numerical sort\\ | ||
- | * 2 - Descending order\\ | ||
- | |||
- | ====Special case tables==== | ||
- | * [[jvs: | ||
- | |||
- | **See Also:**\\ | ||
- | [[jvs: | ||
- | |||
- | [[jvs: | ||
- | [[jvs: | ||
- | [[jvs: | ||
- | [[jvs: |