int im_csv2vips( const char *filename, IMAGE *out )
int im_vips2csv( IMAGE *in, const char *filename )
DESCRIPTIONim_csv2vips(3) reads the CSV (comma separated values) data in filename, and writes the image out in VIPS format. The output image is always 1 band (monochrome), IM_BANDFMT_DOUBLE.
The reader is deliberately rather fussy: it will fail if there are any short lines, or if the file is too short. It will ignore lines that are too long.
Read options can be embedded in the filename. The options can be given in any order and are:
The number of lines to skip at the start of the file. Default zero.
The skippable whitespace characters. Default <space> and double quotes ("). Whitespace characters are always run together.
The characters that separate fields. Default ;,<tab>. Separators are never run together.
The number of lines to read from the file. Default -1, meaning read to end of file.
im_vips2csv(3) writes the VIPS image to the file as ascii text, one line of text per scanline. Complex numbers are written as "(real,imaginary)" and will need extra parsing I guess.
Write options can be embedded in the filename. The options can be given in any order and are:
The string to use to separate numbers in the output. The default is "\t" (tab).
im_csv2vips( "fred.csv:skip:58,sep:,,line:3", out );
Will read three lines starting at line 59, with space, comma and tab as the allowed separators. Note that the ',' has to be escaped with a backslash.
im_vips2csv fred.jpg fred.csv:sep:
Convert a jpeg to CSV, separating numbers with tab characters.
COPYRIGHTHey, you want this? You have it!