User:Michael Bednarek/WTDtHs

This tool allows the insertion of proper dates as  templates into table columns (WTDtHs= W ikipedia T ables D ates as H idden fields). It requires the Microsoft Windows Script Host.

Instructions
Save the code below into a file and name it WTDtHs.WSF.

Save the Wikipedia table code you want to process into a file named as you wish. Invoke the program with WScript //Nologo WTDtHs.wsf "file.txt" >"output.txt".

The Wikipedia table code must specify each row in a single record. Example :  … …  would result in  … … 
 * 17 February 1794 || Saffo ossia I riti d'Apollo Leucadio  || dramma per musica || 2 acts ||Antonio Simone Sografi || Venice, La Fenice
 * 26 January 1796 || La Lodoiska ||  dramma per musica || 3 acts ||Francesco Gonella after Claude-François Fillette-Loraux (after a novel by Jean-Baptiste Louvet de Couvray) ||  Venice, La Fenice
 * 26 January 1796 || La Lodoiska ||  dramma per musica || 3 acts ||Francesco Gonella after Claude-François Fillette-Loraux (after a novel by Jean-Baptiste Louvet de Couvray) ||  Venice, La Fenice
 * HS 1794-02-1717 February 1794 || Saffo ossia I riti d'Apollo Leucadio  || dramma per musica || 2 acts ||Antonio Simone Sografi || Venice, La Fenice
 * HS 1796-01-2626 January 1796 || La Lodoiska ||  dramma per musica || 3 acts ||Francesco Gonella after Claude-François Fillette-Loraux (after a novel by Jean-Baptiste Louvet de Couvray) ||  Venice, La Fenice
 * HS 1796-01-2626 January 1796 || La Lodoiska ||  dramma per musica || 3 acts ||Francesco Gonella after Claude-François Fillette-Loraux (after a novel by Jean-Baptiste Louvet de Couvray) ||  Venice, La Fenice

The program performs no error checking; it is not comprehensively tested but it works for me. Report errors on this page's Talk page. Use at your own risk. Note especially that no check is performed whether the redirected output file already exists and whether you really want to overwrite it. I am unlikely to develop this any further, e.g. dealing with more freely formatted Wikipedia table code where line breaks are used to separate columns.