Search text in Blogger blog backup/export XML file entries and get matching entries data - In-progress test version

Last updated on 9 Sep. 2023 

9 Sep. 2023 Update: I rarely use the software covered in this post now. To see the current software for creating Blogger blogbooks that I use, please visit: Short User Guide to creating Blogger Blogbooks from Backup/Export File using ExportFileFilterAndGenBook and another VBA projects' macros/code (free and open source), https://ravisiyermisc.blogspot.com/2023/09/short-user-guide-to-creating-blogger.html .

end-Update 9 Sep. 2023

I decided to put up and publish this post now on 1 Aug 2023 while this work is in progress, as I wanted to ensure that whatever work I have done till now is available for interested readers. 

I think it will be useful to be able to get matching entries data from Blogger blog backup or export XML file, output as a new XML file. This matching entries only XML file can then be input to BlogExportFileToBook macro covered in a recent previous post, to generate an HTML blog book of it which can be conveniently viewed in a browser.

I have started experimental kind-of work for this. The folder share having test data and code: TestXMLEntrySearch, https://drive.google.com/drive/folders/1btdUPxBmJdi9F4ruwKbR8w0QYn0g3doN?usp=drive_link

First I wanted to check if Findstr of Windows command prompt or Select-String of Windows Powershell (seem to be equivalent to UNIX grep) can do the task. It seems that they cannot. For more details, see 20230801-Copy-Select-String-KB.txt, https://drive.google.com/file/d/19uWm82iq-_54e7LGwKHT4O2vsWKJiIOU/view?usp=drive_link . Note that the commands described in above file were run in another directory. I have copied over the test files to the shared directory but perhaps some tweaking of the paths associated with them in the commands mentioned in above file, may be needed.

As described in above file, FindStr and Select-Str being line-oriented utilities seem to not work properly with Blogger backup/export XML file as the file is not line oriented and some entries' data itself has newline characters.

Next step was to write a small program that read the backup/export XML file (using Load function of support XML classes/library) and output the entries as XML. Later I added a simple search feature which searched the entries for specified search string, and if found then (and only then) write the corresponding entries into output file as XML. The current code for that program/macro is: 20230801-Macro-TestXMLEntrySearch-Code.txt,  https://drive.google.com/file/d/1WIkqhuL0nRal61-dxfN1UBxvwn47-YgE/view?usp=drive_link . I have not done exhaustive testing. In the limited testing I did, the code seemed to work.

Comments

Archive

Show more