topic title: PM Exports
Posts: 1,062
Dave
Joined: 20 Jan 2010
#1
I do not know if anyone has (or wanted) to do PM exports on the forum. Just having tried this recently it seems the options are CSV, CSV (Excel), XML... none seem to be very viewable in their normal format. I admit I did not spend much time trying to find some other way to view the files cleanly, instead spent a little time and hammered together a bunch of sed strings in a script. This script will"translate" the XML export into a basic html doc. It is probably not the cleanest, but IMO the export is at least readable this way.

The Script

Code: Select all

#!/bin/bash
original=$1
cat $original\
|sed"s|<phpbb>|<html>|ig"\
|sed"s|</phpbb>|<html>|ig"\
|sed"s|<privmsg>|<p>|ig"\
|sed"s|</privmsg>|</p>|ig"\
|sed"s|<subject>|<h1>|ig"\
|sed"s|</subject>|</h1>|ig"\
|sed"s|<sender>|<h2>|ig"\
|sed"s|</sender>|</h2>|ig"\
|sed"s|<date>|<h3>|ig"\
|sed"s|</date>|</h3>|ig"\
|sed"s|<message>|<p>|ig"\
|sed"s|</message>|</p>|ig"\
|sed"s|\[quo.*\]|<br><i><b><font color='#00ff00'>|ig"\
|sed"s|\[/quote\]|</font></i></b><br>|ig"\
|sed"s|\[color|<br><font color|ig"\
|sed"s|\[/color\]|</font><br><br>|ig"\
|sed"s|\[|<br><|ig"\
|sed"s|\]|><br>|ig" > $original.html
Copy it, save the file as whatever name you want, chmod 755 to make it executable, run as"CONVERT-XML-HTML export.xml"
It should then make an file named"export.xml.html" that you can view in a web browser. I have been using dillo to view the output.