acsvread
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | acsvread [2010/06/22 21:21] (current) – created jochen | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== acsvread ====== | ||
+ | ===== Motivation ===== | ||
+ | Very frequently data analysis is performed using several different programs at a time (e.g. Excel for text file pre-processing, | ||
+ | |||
+ | ===== Requirements ===== | ||
+ | You should have the data you wish to read in prepared in one common format (that is, make sure to use the same delimiter, etc., when you save the files as CSV). | ||
+ | |||
+ | ===== Function reference ('help acsvread' | ||
+ | < | ||
+ | |||
+ | due to the different approaches when reading csv files, both a cell | ||
+ | and a struct oriented method can be used. | ||
+ | |||
+ | FORMAT: | ||
+ | |||
+ | Input fields: | ||
+ | | ||
+ | a newline seperated string containing a table or | ||
+ | even a cell array with input lines to process | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | plus if set to ' | ||
+ | | ||
+ | this results in a struct array, not a cell array! | ||
+ | further, if headline is empty read headline from | ||
+ | given input, otherwise use this at headline! | ||
+ | | ||
+ | | ||
+ | | ||
+ | either [upper-left-x, | ||
+ | or a string in MS-Excel notation (' | ||
+ | any missing coordinate is stretched to the edge | ||
+ | | ||
+ | | ||
+ | meaning: lines must contain this token to match | ||
+ | | ||
+ | | ||
+ | |||
+ | See also asciiread, splittocell.</ | ||
+ | |||
+ | ===== Options ===== | ||
+ | ==== asmatrix ==== | ||
+ | If not given or set to '' | ||
+ | |||
+ | ==== convert ==== | ||
+ | This flag controls whether or not '' | ||
+ | |||
+ | ==== headline ==== | ||
+ | This option can either be set to a string that, when split with the delimiter, contains the field names of the table to read. Or if the file itself contains that information, | ||
+ | |||
+ | ==== multidelim ==== | ||
+ | Flag whether or not to concatenate multiple consecutive delimiters into one (only useful for very special cases). | ||
+ | |||
+ | ==== numonly ==== | ||
+ | Flag whether non-numeric data should be discarded. | ||
+ | |||
+ | ==== range ==== | ||
+ | By default, '' | ||
+ | |||
+ | ==== readstart / readstop ==== | ||
+ | These two optional settings are useful if the content to read is embedded in information that is of variable length but contains a specific keyword/ | ||
+ | |||
+ | ==== replacef / replacet ==== | ||
+ | Sometimes you want to perform a " | ||
+ | |||
+ | ===== Exemplary calls ===== | ||
+ | * to read in a file which was saved with '','' | ||
+ | ' | ||
+ | ' | ||
+ | * in case this file also has header fields (names in the first row) and you wish to convert the read file into a NrOfRows-by-1 struct, use: <code matlab acsvread_asstruct.m> | ||
+ | ' | ||
+ | ' | ||
+ | ' |
acsvread.txt · Last modified: 2010/06/22 21:21 by jochen