A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Simply amazing! I have 27 sheets, all with picture comments, and most with well over 100 records each. This little tidbit fixed every one in seconds! Needless to say, I'll keep this little script handy from now on. I can't even imagine how long it would have taken to edit each one...
Hopefully this will get taken care of seeing as how it's been happening, apparently, for well over 2 years.
Thank you!
Thanks dlauzon that was exactly what I needed. I created a vbs to clean up my VML file since it was pretty extensive, and here it is in case it helps anyone else:
' drag and drop the .vml file onto this script, new file is saved to the same location with a Fixed_ prefix
' bring in drag and dropped file
Set objArgs = WScript.Arguments
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFSO2 = CreateObject("Scripting.FileSystemObject")
sFile = objArgs(0)
Set fileinfo = oFSO.GetFile(sFile)
' create new file
sFile2 = fileinfo.parentFolder & "\Fixed_" & fileInfo.name
If oFSO.FileExists(sFile) Then
Set oFile2 = oFSO2.CreateTextFile(sFile2)
Set oFile = oFSO.OpenTextFile(sFile, 1)
Do While Not oFile.AtEndOfStream
' read through input file one line at a time
sText = oFile.ReadLine
IStartPos = 0
iStartPos = InStr(sText, "o:relid=")
' if an o:relid is found we do special processing
If iStartPos > 0 Then
' keep appending lines from the input file until we reach o:title
iTitlePos = InStr(sText, "o:title=")
While iTitlePos = 0
sText = sText & oFile.ReadLine
iTitlePos = InStr(sText, "o:title=")
Wend
' find the LAST o:relid if there are more than one
iNextPos = InStrRev(sText, "o:relid=")
If iNextPos > 0 and iNextPos > iStartPos Then
' this is the last o:relid
sItem = Mid(sText, iNextPos, iTitlePos - iNextPos)
' replace the multiple o:relid with only the last one
sText = Left(sText, iStartPos - 1) & sItem & Mid(sText, iTitlePos)
End If
End If
oFile2.WriteLine(sText)
Loop
oFile.Close
WScript.Echo "Done"
End If