# ConvertFile()

Converts a binary log file to a comma-separated values (.CSV) text file or another text file format that you specify.

Member of the DataLogger class.

## Function Prototype

VB .NET

Public Function ConvertFile(ByRef destFileName As String, ByVal startSample As Integer, ByVal count As Integer, ByVal delimiter As MccDaq.FieldDelimiter) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo ConvertFile(string destFileName, int startSample, int count, MccDaq.FieldDelimiter delimiter)

## Parameter

destFileName

The name and destination path of the converted file. Use the file extension of the file type that you want to create.

startSample

The first sample to read.

count

The number of samples to read.

delimiter

Specifies the character to use between fields in the converted file.

All of the delimiter settings are MccDaq.FieldDelimiter enumerated constants. Choices are MccDaq.FieldDelimiter.Comma, MccDaq.FieldDelimiter.Semicolon, MccDaq.FieldDelimiter.Space, and MccDaq.FieldDelimiter.Tab.

## Returns

- An ErrorInfo object that indicates the status of the operation.

## Notes

- Time stamp data is stored according to the timeZone preference and timeFormat preference. Refer to SetPreferences().
- Time stamps in the converted file may be in either 12-hour or 24-hour format based on the value of the timeFormat preference. Time stamps can optionally be converted to local time based on the value of the timeZone preference.
- AI temperature data is returned according to the units preference. Refer to SetPreferences().
- The units preference is only applied to the AI data if the data was logged as temperature data. Refer to GetAIInfo(). This value is ignored if the AI data was logged as raw data.
- The units preference is always applied to CJC data, since it is always logged as temperature data.
- If the destFileName argument ends with a .csv extension, the delimiter parameter must be set to MccDaq.FieldDelimiter.Comma. Otherwise, an INVALIDDELIMITER error is returned.
- You can open a comma-separated values text file (.csv) directly in Microsoft Excel. Text files with extensions other than .csv can only be imported into Excel.