QUERY_CSV

The QUERY_CSV function tests a file or URL for compatibility with READ_CSV and returns an optional structure containing information about the file.

This routine is written in the IDL language. Its source code can be found in the file query_csv.pro in the lib subdirectory of the IDL distribution.

Syntax

Result = QUERY_CSV( Filename [, Info] )

Return Value

This routine returns a long with the value of 1 (one) if the query was successful (and the file type was correct) or 0 (zero) on failure.

Arguments

Filename

A scalar string containing the full pathname or URL of the file to query.

Note: If you are using a URL and you are going to immediately call READ_CSV, the file will be downloaded twice—once for QUERY_CSV and another time for READ_CSV. In this case you could use WGET to retrieve the file yourself.

Info

A named variable in which to return an anonymous structure containing information about the file. This structure is valid only when the return value of the function is 1. The structure has the following fields:

Field

IDL Type

Description

NAME

String

File name, including full path or URL

TYPE

String

File format (always 'CSV')

LINES

Long64

Number of lines

NFIELDS

Long

Number of columns

Keywords

None

Version History

7.1

Introduced

8.5

Added support for URL files.

See Also

QUERY_ASCII, READ_ASCII, READ_CSV, WRITE_CSV, WGET