A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record.
|Type of format||multi-platform, serial data streams|
|Container for||database information organized as field separated lists|
CSV Format Is Use
A CSV is a comma-separated values file, which allows data to be saved in a tabular format. CSVs look like a garden-variety spreadsheet but with a . csv extension. CSV files can be used with most any spreadsheet program, such as Microsoft Excel or Google Spreadsheets.
Here are the rules for creating CSV files:
- Separate data fields with a delimiter, usually a comma. This should be a single character. If you do not want to use a comma, you should choose something like a tab or a pipe (|) character.
- Keep each record on a separate line. Each record must start on its own line, but a single record can span multiple lines.
- Do not follow the last record in a file with a carriage return.
- In the first line of the file, include a header with a list of the column names in the file. This is optional, but strongly recommended; it allows the file to be self-documenting.
- Make sure the header list is delimited in the same way as the rest of the file. This helps guard against the data fields being transposed in the data when it is loaded, which can lead to getting wrong answers when you query the data.
- Remember that the enclosing character (typically double quotes) must be used when required, such as when the delimiter appears in a field.
Difference Between CSV file and Excel?
CSV and Excel or xls are two different types of file extensions which both contain data in them, the difference between the both is that in CSV or comma-separated values the data is in text format separated by commas while in excel or Xls data is in tabular format or we say in rows and columns and in CSV file extension …
CSV file example
CSV is a delimited text file that uses a comma to separate values (many implementations of CSV import/export tools allow other separators to be used; for example, the use of a “Sep=^” row as the first row in the *.csv file will cause Excel to open the file expecting caret “^” to be the separator instead of comma “,”).
If you like my post please follow me to read my latest post on programming and technology.