{"id":7161,"date":"2017-01-18T18:56:20","date_gmt":"2017-01-18T17:56:20","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=7161"},"modified":"2017-01-18T18:56:20","modified_gmt":"2017-01-18T17:56:20","slug":"your-docx-or-your-xlsx-file-and-its-modified-timestamp","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2017\/01\/18\/your-docx-or-your-xlsx-file-and-its-modified-timestamp\/","title":{"rendered":"your OOXML file (&#8220;.docx&#8221;, &#8220;.xlsx&#8221;, &#8220;.vsdx&#8221;, \u2026) and its &#8220;modified&#8221; timestamp"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Office_Open_XML_file_formats\">https:\/\/en.wikipedia.org\/wiki\/Office_Open_XML_file_formats<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/using_timestamps_in_filenames\/create_snapshot_from_OOXML.sh\">https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/using_timestamps_in_filenames\/create_snapshot_from_OOXML.sh<\/a><\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/XMLStarlet\">https:\/\/en.wikipedia.org\/wiki\/XMLStarlet<\/a><\/li>\n<\/ul>\n<p>VSDX does not get listed as an OOXML conform file format, but for this purpose (here) we can treat it like one.<\/p>\n<p>Your &#8220;.docx&#8221; (or &#8220;.xlsx&#8221;) file is a ZIP file with a docProps\/core.xml inside:<\/p>\n<pre>$ unzip -l YOUR.docx\n\u2026\n\u2026 docProps\/core.xml\n\u2026<\/pre>\n<p>This is a convenient way to extract docProps\/core.xml to STDOUT:<\/p>\n<pre>$ unzip -p YOUR.docx docProps\/core.xml\n\u2026<\/pre>\n<p>This is how to get the XML reformatted using xmlstartlet:<\/p>\n<pre>$ unzip -p YOUR.docx docProps\/core.xml | xml fo<\/pre>\n<p>This command line shows you the possible XPath expressions:<\/p>\n<pre>$ unzip -p YOUR.docx docProps\/core.xml | xml el\n\u2026\ncp:coreProperties\/dcterms:modified\n\u2026<\/pre>\n<p>How to extract &#8220;<em>modified<\/em>&#8221; to STDOUT?<\/p>\n<pre>$ unzip -p YOUR.docx docProps\/core.xml | xml\u00a0sel --template --value-of cp:coreProperties\/dcterms:modified<\/pre>\n<p>And how to extract the timestamp w\/o anything but decimal digits?<\/p>\n<pre>$ unzip -p YOUR.docx docProps\/core.xml | xml sel --template --value-ofcp:coreProperties\/dcterms:modified | tr -d ':TZ-'<\/pre>\n<p>\u2026\t\t\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/en.wikipedia.org\/wiki\/Office_Open_XML_file_formats https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/using_timestamps_in_filenames\/create_snapshot_from_OOXML.sh https:\/\/en.wikipedia.org\/wiki\/XMLStarlet VSDX does not get listed as an OOXML conform file format, but for this purpose (here) we can treat it like one. Your &#8220;.docx&#8221; (or &#8220;.xlsx&#8221;) file is a ZIP file with a docProps\/core.xml inside: $ unzip -l YOUR.docx \u2026 \u2026 docProps\/core.xml \u2026 This is a convenient way to extract docProps\/core.xml to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[851,732],"tags":[971,1194,1198],"class_list":["post-7161","post","type-post","status-publish","format-standard","hentry","category-xmlstarlet","category-xpath","tag-create_snapshot","tag-odf","tag-ooxml"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1Rv","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/7161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=7161"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/7161\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=7161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=7161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=7161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}