I want to save a data into a csv file via:
>scrapy crawl spider_name -O ../output/file_name.csv
in another folder than the default one when just using:
>scrapy crawl spider_name -O file_name.csv
however I also want to save the data without any headers. I found that you could include:
FEEDS = {
'file_name.csv': {
'format': 'csv',
'item_export_kwargs': {
'include_headers_line': False,
},
}
}
into settings.py. That now raises the problem that '-O' doesn't replace the file anymore but instead appends when using the command multiple time and more importantly it doesn't work if I use:
FEEDS = {
r'file:///D:\xyz\output\file_name.csv': {
'format': 'csv',
'item_export_kwargs': {
'include_headers_line': False,
},
}
}
for my wanted target folder in Windows.
How do I ensure that the file gets replaced by a new one and that my data gets inserted right away without the header?