{"id":159,"date":"2018-02-09T12:37:04","date_gmt":"2018-02-09T11:37:04","guid":{"rendered":"https:\/\/www.benscoat.eu\/?p=159"},"modified":"2020-11-27T12:38:13","modified_gmt":"2020-11-27T11:38:13","slug":"fast-and-lazy-replacement-in-excel","status":"publish","type":"post","link":"https:\/\/www.benscoat.eu\/index.php\/2018\/02\/09\/fast-and-lazy-replacement-in-excel\/","title":{"rendered":"Fast and lazy replacement in Excel"},"content":{"rendered":"\n<p>During every-day data wrangling, I often have to find and replace elements in Excel. This particularly happens when I open CSV and text files generated with R. Because French locales (<a href=\"https:\/\/www.datacamp.com\/community\/tutorials\/decimal-comma-or-decimal-point-a-googlevis-visualization\">and many others<\/a>) use a comma as a decimal mark, Excel doesn&#8217;t recognise it in such files on my French-set system, and considers these values as text. Unfortunately, this prevents me from making quick checks with formulas&#8230;<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Now, the find-and-replace utility of Excel is simple and efficient\u2014nothing more than a (data) scientist wants\u2014but it&#8217;s hidden somewhere in the menu options, or, even worse in the Mac version, in the GUI. As always with any repetitive and boring task, I had to make an AppleScript for it. I can&#8217;t help it. And here it is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"applescript\" class=\"language-applescript\">tell application \"Microsoft Excel\" to replace used range of active sheet what \".\" replacement \",\"<\/code><\/pre>\n\n\n\n<p>For once, I was fancy having it on a single line \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During every-day data wrangling, I often have to find and replace elements in Excel. This particularly happens when I open CSV and text files generated with R. Because French locales (and many others) use a comma as a decimal mark, Excel doesn&#8217;t recognise it in such files on my French-set system, and considers these valuesContinue reading &rarr;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts\/159"}],"collection":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":1,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"predecessor-version":[{"id":160,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts\/159\/revisions\/160"}],"wp:attachment":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}