{"id":7379,"date":"2017-06-29T12:24:28","date_gmt":"2017-06-29T10:24:28","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=7379"},"modified":"2017-06-29T12:24:28","modified_gmt":"2017-06-29T10:24:28","slug":"your-odf-file-odt-ods-and-its-modified-timestamp","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2017\/06\/29\/your-odf-file-odt-ods-and-its-modified-timestamp\/","title":{"rendered":"your ODF file (&#8220;.odt&#8221;, &#8220;.ods&#8221;, \u2026) and its &#8220;modified&#8221; timestamp"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/en.wikibooks.org\/wiki\/XML_-_Managing_Data_Exchange\/OpenOffice.org_%26_OpenDocument_Format\">https:\/\/en.wikibooks.org\/wiki\/XML_-_Managing_Data_Exchange\/OpenOffice.org_%26_OpenDocument_Format<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/using_timestamps_in_filenames\/create_snapshot_from_ODF.sh\">https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/using_timestamps_in_filenames\/create_snapshot_from_ODF.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>Your &#8220;.odt&#8221; (or &#8220;.ods&#8221;) file is a ZIP file with a meta.xml inside:<\/p>\n<pre>$ unzip -l YOUR.ods\n\u2026\n\u2026 meta.xml\n\u2026<\/pre>\n<p>This is a convenient way to extract meta.xml to STDOUT:<\/p>\n<pre>$ unzip -p YOUR.ods meta.xml\n\u2026<\/pre>\n<p>This is how to get the XML reformatted using xmlstartlet:<\/p>\n<pre>$ unzip -p YOUR.ods meta.xml | xml fo<\/pre>\n<p>This command line shows you the possible XPath expressions:<\/p>\n<pre>$ unzip -p YOUR.ods meta.xml | xml el\n\u2026\noffice:document-meta\/office:meta\/dc:date\n\u2026<\/pre>\n<p>How to extract &#8220;<em>modified<\/em>&#8221; to STDOUT?<\/p>\n<pre>$ unzip -p YOUR.ods meta.xml | xml sel --template --value-of office:document-meta\/office:meta\/dc:date<\/pre>\n<p>And how to extract the timestamp w\/o anything but decimal digits?<\/p>\n<pre>$ unzip -p YOUR.ods meta.xml | xml sel --template --value-of office:document-meta\/office:meta\/dc:date | tr -d ':TZ-' | perl -pe 's\/^(.*)..*$\/$1\/'<\/pre>\n<p>\u2026\t\t\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/en.wikibooks.org\/wiki\/XML_-_Managing_Data_Exchange\/OpenOffice.org_%26_OpenDocument_Format https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/using_timestamps_in_filenames\/create_snapshot_from_ODF.sh https:\/\/en.wikipedia.org\/wiki\/XMLStarlet Your &#8220;.odt&#8221; (or &#8220;.ods&#8221;) file is a ZIP file with a meta.xml inside: $ unzip -l YOUR.ods \u2026 \u2026 meta.xml \u2026 This is a convenient way to extract meta.xml to STDOUT: $ unzip -p YOUR.ods meta.xml \u2026 This is how to get the XML reformatted using xmlstartlet: $ unzip -p YOUR.ods meta.xml [&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":false,"_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-7379","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-1V1","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/7379","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=7379"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/7379\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=7379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=7379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=7379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}