I have a CSV file with 4 headers, and I want to use header #2, this can't be done right now. Has created a patch that allows to choose header size and active header.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

logaritmisk’s picture

Status: Active » Needs review
FileSize
5 KB
logaritmisk’s picture

There were a issue when you only had one header row. Should be fixed in this patch.

logaritmisk’s picture

Status: Needs review » Needs work

The last submitted patch, feeds-csv_parser_allow_multiple_headers-1421328-3.patch, failed testing.

twistor’s picture

Do you mean 4 rows of headers?

logaritmisk’s picture

This is how my CSV file looks like. And it's the second header row that is the "correct" one.

"TOA5","HGA","CR2xx","","v07","TurfProg.cr2","51240","Minute"
"TIMESTAMP","RECORD","RainFall_Tot","WindSpd_WVc(1)","WindSpd_WVc(2)","AirTemp","RelHum","Baro_KPa"
"TS","RN","","","","","",""
"","","Tot","WVc","WVc","Smp","Smp","Smp"
"2013-04-17 06:43:00",686277,0,4.927249,229.5372,6.006531,100,102.1377
"2013-04-17 06:44:00",686278,0,6.2405,226.0809,6.22821,100,102.1551
"2013-04-17 06:45:00",686279,0,5.756,224.368,6.077576,100,102.1304
dbassendine’s picture

Here's a enhancement (I would say) of #3, where you can set the number of headers and the active header by typing the number in a text field, rather than picking from a dropdown that's limited to 1-10. I found my csv had 58 (!) header rows and the active header row had to be #55 (http://scrippsco2.ucsd.edu/data/in_situ_co2/monthly_mlo.csv).

I really wanted to avoid having to preprocess the csv, as I wanted to pull from that URL regularly. This seems like a sensible change for me, any thoughts?

Thanks, David