A GTFS dataset is a .zip file composed of several text files. Depending on what operating system (such as Windows or Mac OS) and which software tools (such as Microsoft Excel or Google Sheets) you use to view the files, you need to take different precautions to ensure the GTFS does not 'break.'
Because GTFS files are meant to be "machine readable," small errors can cause the entire file to become corrupted even if the data looks correct to the human eye.
To unzip the folder containing the GTFS feed, right-click on the folder icon of the ZIP folder, and select "Extract all". A pop-up (left) will show you where the folder will be saved. If you want to save the extracted .txt files in a different location on your machine or want to rename the folder itself, click "browse". Otherwise, click "Extract" to complete the process. If the GTFS feed that you're trying to unzip has a large file size, it may take a few seconds for it to finish unzipping.
If there is another folder inside the folder that is produced when unzipping, this is an indication the file has not been zipped up correctly. See below.
Windows defaults to using Notepad for reading .txt files. However, this does not allow you to sort, cross reference, or easily navigate the text file. It is recommended you use a spreadsheet program such as Microsoft Excel or Google Sheets to work with the .txt files (see Instructions for Mac below if you're working with Google Sheets).
To import a .txt file into Excel, create a new workbook. Then, use Notepad to open the .txt file you want to work with, select-all, and copy-paste it into the first cell of the Excel worksheet.
To make sure the data appears properly in Excel, select the column containing the data, then navigate to the Data menu and select Text to Columns. Make sure the delimiter is set to "Comma." On the left, you can what stops.txt looks like before and after using Text to Columns.
(for Google Sheets - see Instructions for Mac)
In Excel, use the process outlined above to import multiple text files into the same workbook, with each .txt file in its own separate worksheet. For example, import both stop_times.txt and stops.txt.
Stop_times.txt contains stop_id, but not stop_name. In order to get the stop_name next to the stop_id, use VLOOKUP to match them up.
(for Google Sheets - see Instructions for Mac)
When saving a file from Excel to add back into a GTFS feed, download as a comma separated values (.csv) file, not as a tab-delimited .txt file. Once downloaded, without opening the file, change the .csv to .txt. You will get a confirmation that you wish to change the extension. You want to do this change. The file should now be a text file and can be included in your GTFS.
Errors with text files saved this way? See Troubleshooting your GTFS files.
To compress a folder on PC, right-click on the folder where the feed is saved, and select Send to -> Compressed (Zipped) Folder. This will automatically create a new .ZIP folder.
The key thing to remember when zipping up your GTFS files is to ensure you do not create another folder inside the one containing your files. You can be sure you only have one folder's worth of files by unzipping the GTFS, opening the folder that is produced, and seeing the text files. If there is another folder, or multiple folders, the file is not correctly zipped up.
Double clicking on a zip file will 'unzip' the file, producing a folder containing the text files that make up the GTFS.
If there is another folder inside the folder that is produced when unzipping, this is an indication the file has not been zipped up correctly. See below.
Mac OSX currently defaults to using TextEdit for reading .txt files. This does not allow you to sort, cross reference, or easily navigate the text file. It is recommended you use Google Sheets (or if available, Microsoft Excel - see Instructions for PC.)
For Google Sheets, create a new sheet and select Import.
Select the text file you wish to view/edit, and when prompted:
Separator Type: Comma
UNCHECK Convert text to numbers, dates, and formulas - you do not want this.
(for Microsoft Excel - see Instructions for PC)
In Google Sheets, import multiple text files into the same workbook (so there are multiple tabs to choose from.) For example, import both stop_times.txt and stops.txt.
stop_times.txt contains stop_id, but not stop_name. In order to get the stop_name next to the stop_id, use vlookup to match them up.
(for Microsoft Excel - see Instructions for PC)
In Google Sheets, there is no 'saving' since the file is always being saved to Google's servers. To get the file offline for use in your GTFS, you will want to download it.
There are only a few options, and none is as a text file. To get around this, download as a comma separated values (.csv) file. Once downloaded, without opening the file, change the .csv to .txt. You will get a confirmation that you wish to change the extension. You want to do this change. The file should now be a text file and can be included in your GTFS.
Errors with text files saved this way? See Troubleshooting your GTFS files.
Mac OS' native way of zipping up files includes extraneous hidden files that some consumers are unable to read, and may cause your feed to be rejected by them. To ensure your files get zipped without any extraneous hidden files, use a third party zip tool such as YemuZip, or use a PC to do the zipping (see Instructions for PC.)
The key thing to remember when zipping up your GTFS files is to ensure you do not create another folder inside the one containing your files. You can be sure you only have one folder's worth of files by unzipping the GTFS, opening the folder that is produced, and seeing the text files. If there is another folder, or multiple folders, the file is not correctly zipped up.