I am late to the game here but still willing to play.
I have installed the plugin version 0.2.1 and followed all the instructions but do not get any results to show up.
I am using a .csv file and I have tried, QUOTE, SPACE and just plain old “” with nothing in between the “.
My code is as follows:
{exp:weblog:entries weblog="csv_test" limit="10"}
<dt>{title}</dt>
<dt>{categories backspace="9"}{category_name} • {/categories}</dt>
<dd>{golf_addr}</dd>
<dd>{golf_city}</dd>
<dd>{golf_state}</dd>
<dd>{golf_zip}</dd>
<dd>{golf_phone}</dd>
{paginate}
<div class="paginate">
<span class="pagecount">Page {current_page} of {total_pages} pages</span> {pagination_links}
</div>
{/paginate}
{/exp:weblog:entries}
and
{exp:csvgrab url="http://www.grandchestermeadows.com/docs/test.csv"
delimiter=","
encloser="SPACE"
weblog="5"
skip="2”
category_group="3"
title="1"
category_field="2"
use="3|4|5|6|7|8"
fields="golf_addr|golf_city|golf_state|golf_zip|golf_phone"
unique="golf_phone"
}
The display does work because the two manual entries I made to the weblog show up.
Any clues what I am missing here?
Thanks.
{exp:csvgrab url="http://www.grandchestermeadows.com/docs/test.csv" delimiter="," encloser="SPACE" weblog="5" skip="2” category_group="3" title="1" category_field="2" use="3|4|5|6|7|8" fields="golf_addr|golf_city|golf_state|golf_zip|golf_phone" unique="golf_phone" }
Forrest,
I downloaded your test.csv file and looked at it. It contains only carriage returns (\r), no linefeeds (\n). So it is a Mac text file, with Mac line endings, which PHP does not handle. You have to upload it in text mode so that the line endings will be converted to something that PHP understands. Or edit it locally and convert the “\r”s to “\r\n” or “\n”. That is your main problem.
A note: encloser=”SPACE” is really weird. That means that spaces are acting as quotes. encloser=”QUOTE” is fine and the quotes are then optional.
Dan
I see it is now test.txt.
How are you uploading to your website? Are you using Transmit? If so, look here for how to force Transmit to use text mode.
Go back to the CSV file, and set delimiter=”,”. But upload it in “Text mode”.
Also your file is chopped off at the end. The last line does not have a newline at the end of it.
Dan,
I changed back to test.csv, added a return to the last line and uploaded (yes you were correct) using Transmit. I changed the mode to ASCII (Text). I also changed the file in go to test.csv. My other settings are:
{exp:csvgrab url="http://www.grandchestermeadows.com/docs/test.csv"
delimiter=","
encloser="QUOTE"
weblog="5"
skip="2”
category_group="3"
title="1"
category_field="2"
use="3|4|5|6|7|8"
fields="golf_addr|golf_city|golf_state|golf_zip|golf_phone"
unique="golf_phone"
}
Alas still no go. I am really not trying to try your patience, but I know we are very close to a solution. Thanks for bearing with me.
Hi Forrest,
You have use=”3|4|5|6|7|8” (six fields), but only five fields are in fields=”golf_addr|golf_city|golf_state|golf_zip|golf_phone”. I think you don’t mean to have the “|8”. If these don’t match up, CSVgrab fails silently.
Set trace=”true” which will give you more debugging output. That will help if there are further problems.
Also your latest CSV file seems to have too many columns in it, though I don’t think that should cause a problem.
I’m back with what I hope is just one more question.
Since the trial run was a success last night, I am back with the real production run. I have mirrored everything I learned yesterday and have the following code:
{exp:csvgrab url="http://www.editorschoicemusic.com/new/upload.csv"
delimiter=","
encloser="QUOTE"
weblog="1"
category_group=""
skip="1"
title="2"
use="1|3|4|5|6|7|8|9|10|11|12|13|14|15|16"
fields="music_cd|aiff_44|wav_44|aiff_48|wav_48|mp3_128|mp3_320|length|track_description|keywords|styles|instrumentation|tempo|vocals|composers"
unique="aiff_44"
}
When I run this page I get the following error:
The following tag has a syntax error: {exp:csvgrab} Please correct the syntax in your template.
I don’t need a category for these particular entries so that is blank on purpose.
Any suggestions?
Thanks, Forrest
Andrew,
A little oversight there. I forgot that I was working on another domain. I got the plugin installed and the import went almost perfectly. It skipped one field - music_cd, which brings up a question:
Is there a problem with the sequence of the fields? For example. In the spreadsheet the music_cd is the first column and title is the second, however, in the weblog entry form, naturally the title is first followed by the url_title and then the music_cd. Also, in the music_cd field, it is a dropdown list.
Your thoughts?
Thanks,
Forrest
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.