Word文書のOLEストリームからデータを引き出すPythonスクリプトを作成しましたが、OLE2形式のタイムスタンプを人間が読める形式に変換するのに問題があります:(
抽出されたタイムスタンプは 12760233021 ですが、これを 2007 年 3 月 12 日などの日付に変換することはできません。
どんな助けでも大歓迎です。
編集: OK 、2009 年 10 月31 日 10:05:00に作成された Word ドキュメントの 1 つに対してスクリプトを実行しました。OLE DocumentSummaryInformation ストリームの作成日は12901417500です。
別の例として、2009 年 10 月 27 日 15:33:00 に作成された単語 doc は、OLE DocumentSummaryInformation ストリームで 12901091580 の作成日を示します。
これらの OLE ストリームのプロパティに関する MSDN ドキュメントは、http://msdn.microsoft.com/en-us/library/aa380376%28VS.85%29.aspxです。
これらのストリームを引き出す定義を以下に示します。
import OleFileIO_PL as ole
def enumerateStreams(item):
# item is an arbitrary file
if ole.isOleFile('%s' % item):
loader = ole.OleFileIO('%s' % item)
# enumerate all the OLE streams in the office file
streams = loader.listdir()
streamProps = []
for stream in streams:
if stream[0] == '\x05SummaryInformation':
# get all the properties fro the SummaryInformation OLE stream
streamProps.append(loader.getproperties(stream))
elif stream[0] == '\x05DocumentSummaryInformation':
# get all the properties from the DocumentSummaryInformation stream
streamProps.append(loader.getproperties(stream))
return streamProps