{"id":2310,"date":"2019-09-12T17:25:15","date_gmt":"2019-09-12T17:25:15","guid":{"rendered":"http:\/\/sites.la.utexas.edu\/kb\/?p=2310"},"modified":"2020-06-15T18:54:36","modified_gmt":"2020-06-15T18:54:36","slug":"how-to-use-script-to-convert-hebrew-text","status":"publish","type":"post","link":"http:\/\/sites.la.utexas.edu\/kb\/2019\/09\/12\/how-to-use-script-to-convert-hebrew-text\/","title":{"rendered":"How to use script to convert Hebrew text"},"content":{"rendered":"<p>This tutorial will cover how to run a bash script that will convert all .txt files in a directory from broken Hebrew text to readable Hebrew text.<\/p>\n<p>We assume that you&#8217;ve already extracted the text and images from the SWF file and saved it on your Desktop as demonstrated here.<\/p>\n<h2>The Script<\/h2>\n<pre>for file in ~\/Desktop\/texts\/*; \r\ndo name=$(echo \"$file\" | cut -f 1 -d '.'); \r\niconv --from-code UTF8 --to-code ISO-8859-1 \r\n\"$file\" | iconv --from-code ISO-8859-8 --to-code UTF8 &gt;\r\n \"$name-converted.txt\"; done<\/pre>\n<p>I won&#8217;t go into the nitty-gritty of how everything in the command works, but basically, it iterates over every file inside the <em>\/Desktop\/texts\u00a0<\/em>directory, converts it to readable UTF8 encoding, and then outputs the result to a new file with\u00a0<strong>-converted<\/strong> appended to the original filename.<\/p>\n<h2>How do I run it?<\/h2>\n<ol>\n<li>Open\u00a0<strong>Terminal<\/strong>.<\/li>\n<li>If you&#8217;ve saved your exported\u00a0<em>texts\u00a0<\/em>and\u00a0<em>images<\/em> directories somewhere\u00a0<strong>other than ~\/Desktop<\/strong>, feel free to change the beginning part of the script to wherever your saved directories are.\n<ol>\n<li>\n<pre>for file in <em><strong>~<span style=\"color: #ff6600\">\/your-directory-path-here\/<\/span>*; <\/strong><\/em>do name=$ ...<\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li>Paste the script in Terminal and press\u00a0<strong>Enter<\/strong>.<\/li>\n<li>That&#8217;s it! Now, check inside your directory and you should see new .txt files created with\u00a0<strong>-converted<\/strong> appended to the end of the file name. Open them and make sure they contain the correct Hebrew text.<\/li>\n<\/ol>\n<h2>For the Hebrew Flash Remediation project<\/h2>\n<p>We&#8217;re going to be saving our results in two directories:<\/p>\n<ol>\n<li>Box<\/li>\n<li>STA Server (<em>smb:\/\/file.laits.utexas.edu\/sta\/_LAITS_projects\/hebrew\/flash-remediation<\/em>)<\/li>\n<\/ol>\n<p>Whenever you&#8217;re finished with an individual course module, please do the following:<\/p>\n<ol>\n<li>Create new folder in Box with the name of the module you just did (name of the .SWF file on the spreadsheet)<\/li>\n<li>Add the converted .txt file and the\u00a0<em>images<\/em> folder if applicable into that folder.<\/li>\n<li>Do the same but on the STA server.<\/li>\n<li>Mark on the spreadsheet that you&#8217;ve saved the results in both Box and the STA server.<\/li>\n<\/ol>\n<p>We want to save on both and keep them in sync incase Box goes down.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will cover how to run a bash script that will convert all .txt files in a directory from broken Hebrew text to readable Hebrew text. We assume that you&#8217;ve already extracted the text and images from the SWF &hellip; <a href=\"http:\/\/sites.la.utexas.edu\/kb\/2019\/09\/12\/how-to-use-script-to-convert-hebrew-text\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":707,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[200714],"tags":[],"class_list":["post-2310","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/posts\/2310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/users\/707"}],"replies":[{"embeddable":true,"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/comments?post=2310"}],"version-history":[{"count":4,"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/posts\/2310\/revisions"}],"predecessor-version":[{"id":2314,"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/posts\/2310\/revisions\/2314"}],"wp:attachment":[{"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/media?parent=2310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/categories?post=2310"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sites.la.utexas.edu\/kb\/wp-json\/wp\/v2\/tags?post=2310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}