A Quick Guide to the CSV file
In the course of using farm software, you may have come across the “CSV” file type. CSV stands for “comma separated value”. It’s used to store data in a plain-text form, which means that the data can be easily viewed and edited without specialised software. This blog post aims to give you a brief guide to the CSV file so that you can start to work with them effectively.
What does a CSV file look like?
When you open a CSV, the data will be readable because it’s stored as plain-text. Each line (row) within the file relates to one complete record – for example, all the details for one animal. Within an individual line, you will see a number of commas (“,”). These commas denote the data fields – the equivalent of the columns in a spreadsheet. For example, you would in the case of an animal record, you would have data fields for ear tag number, date of birth, breed, etc
Here’s what the data looks like opened in Windows Notepad:
And here’s that same data opened in Microsoft Excel:
Obviously, it’s preferable to work with CSV data in a spreadsheet program for greater clarity. The software that creates the CSV file will write data to the file using a particular layout or structure for the file. For example, as well as the individual data line, the first few lines might look a bit different the the rest and could contain additional information about the data in the file (usually called “header” records). You may also see a line that gives the name of the farm data in each field (i.e. the column headings in a spreadsheet).
Where are CSV files used?
CSV files are used in several ways in farm software:
- To load initial data when first starting with a new farm software program. For example, a CSV file containing the details of all the cattle on your holding can be downloaded from CTS Online and loaded into many of the leading cattle recording programs. This avoids the need for all the data to be entered manually.
- To transfer data between software programs or users of the farm data i.e. exporting and importing data. An example of a data export would be creating a CSV of cattle breeding records for your farm consultant. Data that could be imported from CSV includes animal weights or milk testing results; for example, NMR “essential sampling” csv files contain fat, protein and cell count data.
In an ideal connected world all farm software packages and computer systems would be able to “talk” directly to each other, but this won’t happen anytime soon, so the CSV file provides an means for data to be easily transferred from one system to another. Data transfer is important because all farms need to share data with other organisations for either legislative or management purposes.
What software can be used to handle CSV files?
As mentioned before, the CSV file stores data as plain text. Practically speaking, this means that you can view the data in a CSV file using software that’s already available on most computers.
If a spreadsheet program like Microsoft Excel is installed on your PC, the Windows operating system may automatically “associate” any CSV file stored on your PC with Excel, This means that when you double-click on the file name, it will automatically open in Excel. Alternatively, you can right-click on the CSV file and select the Open with option to use another program to open the file, for example, Windows Notepad.
If you don’t have Microsoft Excel, here’s a few suggestions for software that can help you view and edit the data in CSV file format:
- CSVed (a free editor program that has many useful tools). To find it just google for “CSVed”
- Libre Office (free open source office software with spreadsheet)
- Kingsoft Office (free office software with spreadsheet)
Pingback:Data links to cow heat detection systems by Orchid Farmtech
Pingback:NMR Milk Recording with Orchid FarmWizard by Orchid Farmtech