Post

FileReader.CheckFileFormat

Returns the FileFormat that matches a file name's extension.


Remarks

A static method, so no reader is needed. Only the extension is examined, without regard to case: .raw, .mzML, .mzXML and .mgf are recognized. The file does not have to exist.


Syntax

SyntaxDescription
static CheckFileFormat(string fileName)Reads a file name string and returns the FileFormat value based on the file extension characters.

Parameters

NameTypeDescription
fileNamestringThe file name; only its extension is examined.

Returns

TypeDescription
FileFormatThe format matching the extension.

Exceptions

ExceptionCondition
FormatExceptionThe file doesn’t have an extension or the extension isn’t recognized.

Example

1
2
3
using Nova.Io.Read;

FileFormat format = FileReader.CheckFileFormat("DDA.RAW");   // FileFormat.ThermoRaw
This post is licensed under CC BY 4.0 by the author.

Trending Tags