Help talk:CSV format
Talk pages on this wiki should primarily be used to address possible mistakes as well as missing and superseded information in the documentation.
In case you are seeking support concerning individual questions, please have a look at this page. The Semantic MediaWiki user mailing list is always a good idea for seeking help.
Text included in CSV format[edit]
How can I get the article text included in a query using CSV format?
- In case it is stored in a property just query for this one too. Otherwise it is not possible. Cheers --[[kgh]] 13:02, 8 February 2012 (CET)
Number of results[edit]
Forgive my ignorance but I only seem to get 21 results when I know there are many more.
Thanks --Jeremy.Osborn 14:30, 31 May 2012 (CEST)
- Hi Jeremy, this may have several reasons, e.g. you are sorting by a property not annotated on all pages you wish to see. Also, it may already come from your query description. I think you should play around with your query to see what is happening when changing "variables". Cheers --[[kgh]] 23:10, 31 May 2012 (CEST) PS The mailing list is the better place to ask questions about SMW.
- [View source↑]
- [History↑]
Contents
Thread title | Replies | Last modified |
---|---|---|
'filename' parameter not working | 3 | 22:55, 29 January 2016 |
Limit ignored in CSV export? | 4 | 11:59, 8 April 2015 |
Problems with umlaut | 5 | 11:58, 17 March 2015 |
URL length in result link | 0 | 09:49, 23 October 2014 |
How do you specify tab as a separator? | 0 | 15:28, 26 February 2013 |
Trying to get the output file to be something other than results(#).csv and the parameter isn't helping... e.g., CSV isn't giving me "majors.csv".
(Doing this on referata.com)
Sorry, didn't realize the ask wouldn't display...
{{#ask:[[Category:Students]]|?Has Credits=Credits earned|?Has Major=Majors|?Has Grad Term=Due to graduate|headers=plain|format=csv|filename=majors.csv}}
I think this was indeed an issue with SMW 1.8 and lower. However, I believe that this is working with the recent version. You could verify on http://sandbox.semantic-mediawiki.org/ to be sure.
Now I know why this appeard so familiar to me. Tested this end of December 2015: CSV filename test. Yes it is working now so upgrading the software is your friend.
Hello,
See https://bugzilla.wikimedia.org/show_bug.cgi?id=48756
Limit value is ignored in query--so results exported to CSV are limited to 100. However, I have about 500 total values that I wish to export, that are available.
Using SMW 1.8.0.5.
Any suggestions?
Ditto. I cannot get back more than 100 rows of data ... If only I knew PHP better ...
I found the relevant PHP code anyway and changed it from 100 to 1000. It is located within SemanticMediawiki/includes/queryprinters/SMW_QP_CSV.php line 128 (or thereabouts, depending on SMW version)
I found the section in SemanticMediawiki/includes/queryprinters/SMW_QP_CSV.php and changed it from 100 to 1000, but it had no effect. Still only 100 are exported...
See now https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/242 although I'm not sure if there was a fix. Anyone?
(The issue was also reported at https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/42 but deferred to SMW core)
Hi, i am using SMW 1.8 and when I export data that contains an umlaut (ä,ö,ü,..) as CSV and open this file in Excel directly, then these characters are not displayed correctly. Instead I see things like "ÄÖÜäöüß". Is UTF8 support broken for SMW 1.8?
Heiya Basil, I suspect that the problem is not SMW but Excel. Even though you export the file in UTF-8 Excel opens the file in Latin. What does e.g. Libre office do with the same file? Cheers
I've run into the same issue as well and have a patch which at least fixes it for me. I see that SMW exports the data as UTF-8, but Excel can't figure that out, and it's a bit of a hassle to import the data in the correct format. The solution to this is to add the UTF-8 byte order mark to the beginning of the string to be returned (see http://roosmaa.net/importing-utf-8-csvs-in-excel/). Also setting the delimiter to a semicolon makes Excel happy.
What I've done is add the BOM around line 106 of includes/queryprinters/SMW_QP_CSV.php:
$result .= stream_get_contents( $csv ); // Add the UTF-8 byte order mark (BOM) so that Excel can read this in as UTF-8 $result = chr(239) . chr(187) . chr(191) . $result;
I have the same problem with Excel 2013. Adding the line
$result = chr(239) . chr(187) . chr(191) . $result;
doesn't help. Has anyone an idea how to open the csv-file in Excel with the right character set?
Instead of hacking SMW core it will be more advisable to change settings in Excel. I thing this should do the trick: [1] (German only :( ). Supposedly newer versions should have similar settings, too. LibreOffice is much nicer in this respect since it politely asks upon import which charset to use.
There is also an new excel format. This may be an alternative too.
[1] http://www.rechtsmedizin.med.uni-muenchen.de/service/anleitungen_hilfe/excel_csv_utf8/index.html