Tutorial: Exporting Zotero to Excel

Zotero's a great tool for managing your citation library, but sometimes you need that data elsewhere, and though Zotero has some good export features, you may sometimes want something like a simple spreadsheet of citations to work with.Zotero runs on a SQLite database, which makes report generation and, thereby, conversion to a different format difficult for the lay user.  To export Zotero, we will open the SQLite database, submit a query, and then copy the results to Excel, Calc, or another spreadsheet program.Let's get started!

  1. First, you will need to download and install the Firefox SQLite Manager.  Do a quick internet search to find it or go to "Tools > Add-ons" and search there.
  2. Restart Firefox when prompted.
  3. Now, click on the "Tools" menu and select "SQLite Manager."
  4. In the manager, you will need to open your Zotero database, which is located in your Firefox profile folder.  Rather than querying the database directly, find the zotero.sqlite file on your machine (do a web search if you're unsure where your Firefox profile folder is stored on your particular operating system), and make a copy of it to another location (like your desktop).  Though we will not be making any changes to the database, it's better to be safe than to mess up your database.  In SQLite Manger, click the folder icon, find your copied database file, and click "Open."
  5. This may take a moment.  If a popup comes up saying that it's taking a while, just say continue (your database may be large).
  6. Now that your database is open, click on the "Execute SQL" tab in the right pane.
  7. In the "Enter SQL" box, replace the default "SELECT * FROM tablename" with the following query:


    /* Begin query. */
    /* Basic SELECT statement. */
    SELECT
    /*Identify which fields to SELECT for your output. The left identifier represents the database abbreviated name (set below in the FROM and JOIN statements) and the database field name we want, while the right identifier (after the AS statement) represents the column header as it will appear in your output. */
    i.itemID AS ITEMID,
    title.value AS TITLE,
    t.typeName AS TYPE,
    d.value AS DATE,
    issn.value AS ISSN,
    isbn.value AS ISBN,
    doi.value AS DOI,
    url.value AS URL,
    pub.value AS PUB,
    issue.value AS ISSUE,
    volume.value AS VOLUME,
    series.value AS SERIES,
    pages.value AS PAGES,
    proceedingsTitle.value AS PROCEEDINGS,
    bookTitle.value AS BOOK,
    abstract.value AS ABSTRACT,
    c1.firstName AS AUTHOR_1_FIRST,
    c1.lastName AS AUTHOR_1_LAST,
    c1.shortName AS AUTHOR_1_SHORT,
    ct1.creatorType AS AUTHOR_1_TYPE,
    c2.firstName AS AUTHOR_2_FIRST,
    c2.lastName AS AUTHOR_2_LAST,
    c2.shortName AS AUTHOR_2_SHORT,
    ct2.creatorType AS AUTHOR_2_TYPE,
    c3.firstName AS AUTHOR_3_FIRST,
    c3.lastName AS AUTHOR_3_LAST,
    c3.shortName AS AUTHOR_3_SHORT,
    ct3.creatorType AS AUTHOR_3_TYPE,
    c4.firstName AS AUTHOR_4_FIRST,
    c4.lastName AS AUTHOR_4_LAST,
    c4.shortName AS AUTHOR_4_SHORT,
    ct4.creatorType AS AUTHOR_4_TYPE,
    c5.firstName AS AUTHOR_5_FIRST,
    c5.lastName AS AUTHOR_5_LAST,
    c5.shortName AS AUTHOR_5_SHORT,
    ct5.creatorType AS AUTHOR_5_TYPE,
    t1.name AS TAG_1,
    t2.name AS TAG_2,
    t3.name AS TAG_3,
    t4.name AS TAG_4,
    i.dateAdded AS DATE_ADDED,
    i.dateModified AS DATE_MODIFIED,
    i.key AS ZOTERO_KEY,
    extra.value AS EXTRA
    /* The general FROM statement merely queries the `items` table. This table does not have much information in it, so all the information we want will be added with JOIN commands below. */
    FROM
    items i
    /* Begin JOIN commands. First JOIN command.
    Join command. Depending upon the information (whether there is one value or many and whether the value is essential to returning a row), we may use either INNER JOIN or LEFT JOIN. */
    INNER JOIN
    /* The database table name (on the left) and the abbreviated table name (on the right), which we reference in our SELECT query above. */
    itemDataValues title
    /* Identifies the conditions that direct what data is attached to the `items` table based upon the JOIN command. */
    ON
    title.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'title' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    /* Additional JOIN statements. Each of these statements is necessary to attach a new table of information to our initial `items` table. */
    LEFT JOIN
    itemTypes t
    ON
    t.itemTypeID = i.itemTypeID
    LEFT JOIN
    itemDataValues issn
    ON
    issn.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'ISSN' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues doi
    ON
    doi.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'DOI' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues isbn
    ON
    isbn.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'ISBN' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues url
    ON
    url.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'url' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues pub
    ON
    pub.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'publicationTitle' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues d
    ON
    d.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'date' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues abstract
    ON
    abstract.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'abstractNote' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues pages
    ON
    pages.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'pages' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues issue
    ON
    issue.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'issue' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues series
    ON
    series.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'series' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues volume
    ON
    volume.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'volume' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues proceedingsTitle
    ON
    proceedingsTitle.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'proceedingsTitle' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    itemDataValues bookTitle
    ON
    bookTitle.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'bookTitle' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    LEFT JOIN
    creatorData c1
    ON
    c1.creatorDataID = (SELECT creatorDataID FROM creators WHERE creatorID = (SELECT creatorID FROM itemCreators WHERE itemID = i.itemID LIMIT 0,1) LIMIT 1)
    LEFT JOIN
    creatorTypes ct1
    ON
    ct1.creatorTypeID = (SELECT creatorTypeID FROM itemCreators WHERE itemID = i.itemID LIMIT 0,1)
    LEFT JOIN
    creatorData c2
    ON
    c2.creatorDataID = (SELECT creatorDataID FROM creators WHERE creatorID = (SELECT creatorID FROM itemCreators WHERE itemID = i.itemID LIMIT 1,1) LIMIT 1)
    LEFT JOIN
    creatorTypes ct2
    ON
    ct2.creatorTypeID = (SELECT creatorTypeID FROM itemCreators WHERE itemID = i.itemID LIMIT 1,1)
    LEFT JOIN
    creatorData c3
    ON
    c3.creatorDataID = (SELECT creatorDataID FROM creators WHERE creatorID = (SELECT creatorID FROM itemCreators WHERE itemID = i.itemID LIMIT 2,1) LIMIT 1)
    LEFT JOIN
    creatorTypes ct3
    ON
    ct3.creatorTypeID = (SELECT creatorTypeID FROM itemCreators WHERE itemID = i.itemID LIMIT 2,1)
    LEFT JOIN
    creatorData c4
    ON
    c4.creatorDataID = (SELECT creatorDataID FROM creators WHERE creatorID = (SELECT creatorID FROM itemCreators WHERE itemID = i.itemID LIMIT 3,1) LIMIT 1)
    LEFT JOIN
    creatorTypes ct4
    ON
    ct4.creatorTypeID = (SELECT creatorTypeID FROM itemCreators WHERE itemID = i.itemID LIMIT 3,1)
    LEFT JOIN
    creatorData c5
    ON
    c5.creatorDataID = (SELECT creatorDataID FROM creators WHERE creatorID = (SELECT creatorID FROM itemCreators WHERE itemID = i.itemID LIMIT 4,1) LIMIT 1)
    LEFT JOIN
    creatorTypes ct5
    ON
    ct5.creatorTypeID = (SELECT creatorTypeID FROM itemCreators WHERE itemID = i.itemID LIMIT 4,1)
    LEFT JOIN
    tags t1
    ON
    t1.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 1)
    LEFT JOIN
    tags t2
    ON
    t2.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 1,1)
    LEFT JOIN
    tags t3
    ON
    t3.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 2,1)
    LEFT JOIN
    tags t4
    ON
    t4.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 3,1)
    LEFT JOIN
    deletedItems
    ON i.itemID = deletedItems.itemID
    LEFT JOIN
    itemDataValues extra
    ON
    extra.valueID = (SELECT itemData.valueID FROM itemData WHERE itemData.fieldID = (SELECT fieldID FROM fields WHERE fields.fieldName = 'extra' LIMIT 1) AND itemData.itemID=i.itemID LIMIT 1)
    /* End JOIN statements. */
    /* Optional JOIN Statements. */
    /* This is an optional JOIN statement to select for a specific collection. To only show a specific collection in your output, remove the double-hyphen from the beginning of the statement and replace the collectionName value (e.g. "Instructional Design") with the name of your desired collection (encased by quotes). */
    --INNER JOIN collectionItems ON collectionItems.itemID = i.itemID AND collectionItems.collectionID = (SELECT collectionID FROM collections WHERE collectionName = "Instructional Design" LIMIT 0,1)
    /* End optional JOIN statements. */
    /* Final conditional WHERE statement allows us to ignore entries that have been deleted in Zotero. */
    WHERE deletedItems.itemID IS NULL
    /* If you would like to add any additional selection criteria, this is the place to do it. Here are some examples that you may wish to use. Merely remove the double-hyphen from the beginning of a condition to make it active in the query. */
    /* Begin optional conditions. */
    /* Only show journal articles. */
    --AND t.typeName = "journalArticle"
    /* Only show items where the first author's last name is Smith. */
    --AND c1.lastName = "Smith"
    /* Only show items from a particular publication. */
    --AND pub.value = "Teachers College Record"
    /* Only show items added to Zotero after January 1, 2010. */
    --AND i.dateAdded > "2010-01-01"
    /* End optional conditions. */
    /* End query. */

  8. Click "Run SQL." (Note: We are not making any changes to the database, just running a Select query. If you would like to make any conditional queries on the database, you can use the notes in the query to help you edit it directly, or you can just wait until you get the data to a spreadsheet program. Feel free to hit "Run SQL" as you make edits to see how the output changes.)
  9. In the bottom pane, you will see your output.  Left-click on the first entry, scroll all the way down, and then shift+left-click on the last entry to select them all.
  10. Right-click on the selected entries and select "Copy Row(s) as CSV" (or use the MS Excel compatible option if appropriate).
  11. Finally, open your favorite spreadsheet program, paste your results, and you're done.  (Note: If your spreadsheet does not break up the values properly, you will need to paste the text into Notepad or a similar text editor and save it as a file with the .csv extension.  Then, go back to the spreadsheet and import the .csv file.)

Let me know if this was helpful for you!

Comments

This works great -- thanks for posting it! Wondering if you could add the code needed to add each source's tags and what kind of file it is (journal article, etc.) to this query?

Thanks!

Graham

Royce Kimmons's picture

Thanks. Just updated the code to be shorter and to give the source type as well (journal article, etc.), but tags are tricky business. The only way that I can think of to get them out is via an external scripting tool like PHP. Will try to hone my SQL ninja skills some more, but at this point, I don't think it can be done with a single SQL query.

Hi Royce.

This looks like great work. I like Zotero:
1. as a place to store my references
2. the easy was it provides to "farm" references from libraries, the web etc.
3. its ready ability to export bibliographies.

But it is a little buggy at times. Plus I need to be able to access the data it stores in more general ways than are in the standard interface. The Word add-in is great, but you can't manipulate data very easily in Word. I use Excel (with regexp extension) as my Swiss army knife for day-to-day low-level data manipulation. I will use the work you have posted as a template for SQL-level access to the Zotero data store from Excel. When I've done that, I will get back to you.

I note that the Zotero people seem in general to prefer to maintain a Zotero-specific API rather than encourage SQL-level manipulation. You get round that problem by copying the Zotero database, but that may not be flexible or dynamic enough for me. Plus I'm still at a very low level in JavaScript. I need to improve in the near future, but must "complete" my literature review first.

I'm also a Ph.D student, albeit a much older one than you are. I'd like to tell you (and the rest of the world) more, and to do that I need to set up my own website. I long ago concluded that a Drupal-based CMS approach would be right for me there, and I notice that your site is Drupal driven. Have you documented your use of Drupal, and if so, where? Do you host your own Drupal site, or have you found a good hoster for Drupal?

My research, incidentally, is not a million miles from yours - I'm looking at the question:

"How do knowledge workers manage their personal information and knowledge and how can they be helped to improve their personal knowledge management (PKM)?"

Mark, Rennes, France.

Royce Kimmons's picture

Hi Mark,

Thanks for the thoughtful reply! Zotero is one of those tools that I've quickly come to love for how much easier it has made my life as a doc student. As far as the API goes, I haven't looked into it much, because I haven't needed much dynamic access to the database but have, rather, used Zotero in some capacities as a data-gathering tool and have merely needed a one-way feed from it (for which, querying the database seemed to be the simplest answer). Interestingly enough, the reason that I wrote this query to begin with was so that I could take citations into a csv file in order to import them as Drupal nodes (using the Biblio module). I've done this on two sites thus far (though both may not be active yet): http://mobilelearningportal.org and http://alienrescue.edb.utexas.edu/AlienRescueNetwork

If I'm a fan of Zotero, though, I'm a borderline psychofant for Drupal. This site is the eighth or ninth site I've developed with it, and I use it for both research and work. I haven't documented much of what I've done with it, because the community documentation tends to be so good already that I rarely have a question that I can't find a quick answer to with a simple search. As far as hosts go, I've used Hostmonster in the past and liked it. I'm currently using JustHost (because it was much cheaper with their introductory offer) but may switch back at some point. I also run some Drupal development sites on my own server (like http://rkimmons.no-ip.org/dev/drupal ), so I've tried a few methods. I'd probably recommend going the host route, though, if you're just getting started with it, because most even have one-click installations which prevents you from having to configure a LAMP environment and allows you to focus more on your content.

I currently use Drupal 6 on all of my sites, and some of the contributed  modules that I cannot live without include: CCK (including FileField), Views, Cobalt, Biblio, and WYWSIWYG (with TinyMCE).

If you have concrete questions about using Drupal or how to solve a particular problem with it, I'd be happy to help, but it's such a robust and flexible tool that it's difficult to say much of anything useful without a context for what you want it to solve for you.

Royce

Hi again Royce.

Thank you for your very helpful reply.

I have two reasons for wanting to use Drupal.

Firstly: Not only am I a (part-time)Ph.D. student, but I am also a teacher. As a school, we currently use Google Apps to give us some community website features, but Google Apps was never intended to be the learning management which we are trying to make it into.

Secondly: as part of my research, in which the principal methodology is action research, I need to be able to work with my research subjects and collaborators.

My ideal template for a good Drupal site is the one used by developer Pierre at NeoTech Systems. I am also a great fan of his information management system InfoQube (which used to be called SQLNotes). See http://www.sqlnotes.net/drupal5/

Thank you very much for your offer. I need to specify more clearly what I want from my site before I get too heavily into the Drupal aspects, so that will be in the summer rather than in the spring.

Royce Kimmons's picture

Cool site.

Initially, as a practitioner, I was really interested in Drupal as an LMS, too, and was a bit distraught that there weren't more school-oriented modules out there. And, though I don't think Drupal would be harmed by anyone creating LMS-like features for it, I've come to realize that perhaps the true value of Drupal lies in its anti-LMS-ness.

Maybe. Well, at least, suffice it to say that now I'm much more interested in using it to support Personal Learning Environments and Personal Learning Networks than as an LMS, and I think that it's much more suited to that anyway.

Anyhow, good Drupaling in the summer!

Hello, can you think of any reason why this query would return no results? I tried a much simpler query to make sure the problem wasn't with my zotero.sqlite file (SELECT * FROM items) and that worked fine... I'm wondering if something in the table joins is keeping it from returning the expected results.

--Billy S.

I changed the 6th line up from the bottom, from "INNER JOIN collections" to "LEFT JOIN collections" and got results.

I edited the query so the column headers would be a bit more descriptive (see below). Thanks for putting the work into this! I'm going to use it all the time now!

--Billy S.

Query removed and incorporated into main query.

Royce Kimmons's picture

Great additions, Bill! I've updated the script in the post to reflect your changes with one exception. When you ran the initial script and got a null result, did you change the collection name from "Instructional Design" to a collection that you had created in Zotero (I realize now that I wasn't explicit about this initially, but have updated since)? If not, then it was returning only the results for collections named "Instructional Design," which you probably didn't have. Doing a LEFT JOIN instead of an INNER JOIN basically disregards the filter, so if you want all the results, not just from a single collection, then your LEFT JOIN approach works great.

Hello!

Thanks for these instruction - it worked with me, but i have the problem that i get no information like author, booktitle in the table after "run sql". there is only type and sometimes some numbers in the other cells.

csv:
"8",,,,,,,,,,,,"book",,,,,,
"10","0006-291X",,,,,,,,,,,"journalArticle","0006-291X","0006-291X","0006-291X","0006-291X","0006-291X","0006-291X"

how do i get the book title, authors names, year in the output?

Thanks!

Royce Kimmons's picture

I updated the script today, and it should fix this problem. So, try the new, updated script and let me know if it solves your issue.

Thank you for this code! I'm working on a research project about data citation practices and this code is most helpful for managing some of the basic data extraction I am doing from articles. I'm admittedly naive when it comes to SQL, so I'm wondering how I might go about adding additional fields to this query. In particular, I would like to extract the abstract, journal volume/issue, and pages from zotero. Could you help me out with the SQL code for these fields or let me know where to find the "official" sql names of the fields in zotero so i can mimic your code for those fields. Sorry that's so basic...I'm a biologist with GUI programming experience, but not much practical SQL knowledge. Thanks!

Royce Kimmons's picture

The following fields have been added to the script, per your request: issue, volume, abstract, series, pages.

I'm getting an error message that says the "likely error is" then lists the whole script. I've changed the collection name to a collection I actually have, and tried changing INNER to LEFT JOIN, with no success.

Any suggestions?

Sorry, I don't know much about SQL queries, but I could really use this solution - thanks for working on it!

Miles
miles.kimball@gmail.com

thank you so much for this. i tried following it but am only generating numbers. the following is a C&P of one of the lines:

"14","0003-066X",,,,,,,,,,,"journalArticle","0003-066X","0003-066X","0003-066X","0003-066X","0003-066X","0003-066X"

any idea what i may be doing wrong? your directions are clear so i'm not sure what i've done wrong.

Royce Kimmons's picture

I'm not sure. Is it just returning the one line or are there more entries?

In all fields except authors I have issn number of the articles as SQLrun result. There is nothing in authors fields. SQLrun is returning several lines, I started to use zotero yesterday, so I have a couple of articles only.

Royce Kimmons's picture

Darren seems to have fixed this issue; see his reply above.

I had to qualify the NATURAL LEFT JOIN with LEFT JOIN in order to get the correct output. Otherwise, the last value selected for the NATURAL LEFT JOIN value was produced for each of the selected fields which used the NATURAL LEFT JOIN.

Query removed and incorporated into main query.

Thanks,

Darren

Royce Kimmons's picture

Thanks, Darren.

The post below will fix the problem for : generating numbers

Royce Kimmons's picture

I also did an update to the code which should fix it.

Hi, I appreciate the tutorial, but I can't figure out how to add other fields to the export. Specifically, I'd like to add a list of tags to each record. Ideally, they'd be in separate columns, but I'd take them in one column for each record of necessary. Can anyone help me on that?

Royce Kimmons's picture

Extra fields need to be added in both the first SELECT area of the query (to tell it what to output), and they need to use a LEFT or INNER JOIN of some kind. If you tell me which field you would like to add, I may be able to help. Otherwise, the simplest way is just to change the fields.fieldName value for one of the entries.

Royce Kimmons's picture

And I did add tag functionality to the new script which will output the first four tags of any entry.

Has anyone tried to import this data to Google Fusion Tables? From there, you could generate a nice map / timeline widget. I know a lot of my research originates from a few key locations, but would be good to map this out one day!

This has been a real help to me and I'm sure to many others.

I want to try to figure out how to use the creatorType and creatorTypeID to set out whether authors are actually authors or contributors, editors, etc and put them into relevant columns for those creator types.

Evidently it's there in the zotero.sqlite file, but it's way beyond me to sort it out. I guess it's really time consuming, though, or you'd have done it here!

Many many thanks for your work.

Andrew.

Royce Kimmons's picture

Thanks for the feedback, Andrew!

I've added in the feature that you wanted to the original query. Now after every author name there will also appear a field that identifies the author type. It only required a few extra lines per author, so it wasn't a big addition.

Adding this was also good, because it helped me to find some labeling errors in the author numbering, and I took the opportunity to add some notes to help make the query's functioning more transparent and to help other users add more conditionals.

Iterations to perfection!

Royce

Royce, the new code works like a charm. Newbies, like me, particularly appreciate the detailed explanations incorporated in the code.

I do miss the option of restricting the query results to a particular collection though. I've tried to incorporate it in the new code, but without success. Could you please give some pointers of how one could restrict the query to a particular collection?

Many thanks for sharing the wealth.

B.

Royce Kimmons's picture

Thanks for the feedback!

I went ahead and included collection as an optional JOIN statement just before the WHERE statement. Remove the double-hyphen, change the collection name, and you should be good to go!

Royce

hi,

thanks for this code, it sure helps a lot.

i just want to ask, is it possible to just export a certain "Collection" under "My Library"? i looked at the exported data in Excel, there isn't any data that shows where the articles have been grouped in certain "Collection". if not i would have happily do it manually from the Excel, choose only the articles that i have grouped in certain "Collection" and remove the others.

please help look into it, thanks!

Royce Kimmons's picture

Yes, you can do this. Look near the end of the script where it says "/* This is an optional JOIN statement to select for a specific collection." There it explains how to export only a single collection.

Cheers!

I don't know if it's just me or if perhaps everybody else experiencing issues with your site. It appears as though some of the text on your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as well? This might be a problem with my browser because I've had this happen previously. Cheers

Royce Kimmons's picture

Hmm, haven't noticed that before. What browser are you using? FF, Chrome, Safari, and IE 9 all work fine for me.

Thanks for that code : it has been a wonderful help for me !! Anyway, just a small thing about the tags, there's a mistake in the code and the tags sorted are the first one and the numbers 3 to 5 (so not the second one).

Below is my correction for the code to sort out the first fours :
LEFT JOIN
tags t1
ON
t1.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 1)
LEFT JOIN
tags t2
ON
t2.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 1,1)
LEFT JOIN
tags t3
ON
t3.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 2,1)
LEFT JOIN
tags t4
ON
t4.tagID = (SELECT tagID FROM itemTags WHERE itemID = i.itemID LIMIT 3,1)

And thanks again for your work !

Royce Kimmons's picture

Thanks Marie, you're right. I'll update the script!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.