I have an excel with a few thousand sources arranged in this way:
Example 1:
Abbott KW, Snidal D (2009) The Governance Triangle: Regulatory Standards Institutions and the Shadow of the State. In: Mattli W , Woods N (eds) The Politics of Global Regulation, pp. 44–88. Princeton University Press, Princeton, NJ
Example 2:
Moschella M , Tsingou E (eds) (2013) Great Expectations, Slow Transformations: Incremental Change in Financial Governance. ECPR Press, Colchester
I need to split them into 7 columns with this data:
- first author
- second author
- third to N author
- publication year
- title of source article
- published in (not always included, but always starts with In:)
- More info - means everything after the published in/after title of source article (in case it was not part of a larger publication)
I tried using the split into columns tool in excel, but because the data is so varied I couldn't do it efficiently. Does anyone know a solution to this?
Try this VBA macro. It uses regular expressions to parse out the different segments; but if data is not how you have presented, it will fail; so if there are failures, you'll need to see how it mismatches either my assumptions or the way you presented the data.
The macro assumes the data starts in A1 and is in column A, with no label in row 1. The results are written into column B and subsequent; with a label row 1 -- but these could be placed anywhere.
This code goes into a regular module.