Picking up plaintext references

So, here’s the problem I’m trying to solve for a friend. He wrote a 40-page thesis using CWYW, which has 570 references (Numbered style). He then proceeded to screw up by editing the document in Google Docs. Every single reference is now plaintext, and I’m trying to help him use this with CWYW to fix the order.

He still has the old document with the citations intact. However, he has made heavy changes to it in the Google Docs version, which can’t be easily replicated. However, since he took care not to change any reference numbers , if I paste the new document into the end of the intact older version, the reference numbers would still be correct according to the order of first appearance (!), since the original document is the first half of the new one. The thing is, they’re all plaintext.

Is there any way to make CWYW recognize plaintext [1] as reference 1 in the list, instead of [#1] (which is what happens when I make it so that [] are picked up as temporary citations), since record numbers unfortunately don’t match the citation order? It’s a 42000-word thesis, so it’s nearly impossible to fix this manually. Thanks in advance.

Thank you for your time. Solutions two and three, while tedious, would indeed work, and one of those is probably what my friend will do if we can’t get an automated solution. Number one, however, is what I’m most intrigued with, since it would probably be the fastest method. Some pages are pretty heavily rewritten, with references moved around quite a lot. Would this still be feasible?

Drag each reference to a new library in order until you get a record number that matches the number it should be. This is really a little pain, because if you make a mistake.

I run into a similar problem with an old Word document, where I only had a plain text version.

I wrote two small python scripts to help me with this: The first one takes all references and searches for them using Pubmed. The resulting file can be imported into a new Endnote library, which can subsequently be used with the second script to convert all numbered citations in a Word file back to Endnote placeholders aka curly brackets. Endnote will detect this and if used with the new library will fill on all the missing information to allow editing of the citation list.

The scripts can be found on github and are free to use and modify github.com/TischerT/endnote_convert