CSV Exports - Ordering of columns using scrapy crawl -o output.csv
You can solve it from adding a line in settings.py
FEED_EXPORT_FIELDS = ['field1', 'field2', 'field3']
There is a relevant field_to_export
attribute in CsvItemExporter
, but, as far as I understand, there is no way to set it from the command-line. You need to do it through the pipeline, see:
- How can I use the fields_to_export attribute in BaseItemExporter to order my Scrapy CSV data?