File Exchange

image thumbnail


version 1.0 (3.1 KB) by

Returns the number of channels, header lines, and the delimiter string for a given text file.



View License

The Util_GetFileInfo function returns the number of channels, header lines, and the delimiter string for the file with name FILENAME.

Several assumptions are made about the data file:
1. The last line in the file contains a representative line of data
2. The delimiter is either a comma, semicolon, tab, or space
3. In a line of data, the number of actual delimiters exceeds the number of any of the other candidate delimiters (commas, tabs, &c.)
4. The first three lines of data have matching data types (i.e., number or string) and all have the correct number of channels. Everything preceding this point is considered to be the header.

> FILENAME - the name of the file whose number of channels, number of header lines, and delimiter string will be determined.

> CHAN - the number of channels in the data file
> HEADERLINES - the number of header lines in the data file
> DELIM - the data file's delimiter string (e.g., ';')
> PATTERN - the pattern string to be used in file loading (e.g., %f%f%f)

Written by Alex Andrews.
Last updated: February 13th, 2012.

FeatureFinder is a free MATLAB tool that lets you organize your signals, visually review them with speed and ease, apply filters and normalization, and export meaningful signal features in a ready-to-analyze format. Learn more at

Comments and Ratings (0)

MATLAB Release
MATLAB 7.13 (R2011b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video