Since it's in excel, I just use excel itself to rewrite them for me. I do it across several columns so I can go through each step and see the results, rather than doing it all at once in one big equation.
I'll do the example you presented above and give you the equations in the following posts.[DOUBLEPOST=1378838257,1378837781][/DOUBLEPOST]So in the first row, first column you have something like:
C:\MainProject\ProjectImages\Images4000\specialproject4000gaba_0001.jp2
In the cell to the right of it use this equation to get just the filename:
=MID(A1,FIND("0\",A1)+2,100)
It looks for "0\" but if that changes you'll need to search for something different. You could also use:
=MID(A1,FIND("specialproject",A1),100)
so the above two equations provide:
specialproject4000gaba_0001.jp2[DOUBLEPOST=1378838723][/DOUBLEPOST]In the next cell to the right, use the equation:
=LEFT(B1,FIND("_",B1)-1)
Which will remove the index and file type, giving you this:
specialproject4000gaba
then in the following cell to the right, let's extract the index. Now I'm going to assume that the format is always NNNN.jp2, but if it's different elsewhere obviously the equation will need to change:
=VALUE(LEFT(RIGHT(B1,8),4))
This looks at the full file name, grabs the last 8 characters, then grabs the first 4 characters of that substring, then converts it to a number. Of course you could split this up into several steps as well if it's easier to understand.
It returns:
1
Now you have the two parts you need to create your web links.[DOUBLEPOST=1378838864][/DOUBLEPOST]The next cell to the right wraps it all up using string concatenation:
="https://thesiteweuse.org/stream/" & C1 & "#page/n" & D1 & "/mode/1up"
Which gives the result of:
https://thesiteweuse.org/stream/specialproject4000gaba#page/n1/mode/1up[DOUBLEPOST=1378839094][/DOUBLEPOST]Copy the equations down the rows to cover all your input, and you've got a row with correct URLs. You may want to copy them, then paste them into a text editor, or back into excel using "paste values" so you get the final URLs, rather than equations. It took one colum for the original string, and 4 columns with equations to get the file name, get just the project name and index, and then combine them into the final URL.
I used the following text manipulation functions in the process:
MID
FIND
LEFT
RIGHT
VALUE
These are well documented and there are a ton of online tutorials if you end up needing to alter any of the above. While I could write a program to do this for me, I find that this is often just as quick and gives me instant gratification without having to debug so much.