{"id":75,"date":"2008-04-28T11:23:48","date_gmt":"2008-04-28T10:23:48","guid":{"rendered":"http:\/\/stuphi.co.uk\/wordpress\/?p=75"},"modified":"2008-04-28T11:23:48","modified_gmt":"2008-04-28T10:23:48","slug":"by-the-power-of-sed","status":"publish","type":"post","link":"https:\/\/stuphi.co.uk\/wordpress\/?p=75","title":{"rendered":"By the power of SED"},"content":{"rendered":"<p><a href='http:\/\/stuphi.co.uk\/wordpress\/wp-content\/uploads\/2008\/04\/title1.png'><img loading=\"lazy\" src=\"http:\/\/stuphi.co.uk\/wordpress\/wp-content\/uploads\/2008\/04\/title1.png\" alt=\"It\\&#039;s a graph!\" title=\"title1\" width=\"309\" height=\"183\" class=\"alignright size-full wp-image-76\" srcset=\"https:\/\/stuphi.co.uk\/wordpress\/wp-content\/uploads\/2008\/04\/title1.png 309w, https:\/\/stuphi.co.uk\/wordpress\/wp-content\/uploads\/2008\/04\/title1-300x177.png 300w\" sizes=\"(max-width: 309px) 100vw, 309px\" \/><\/a>I think I have just used <a href=\"http:\/\/en.wikipedia.org\/wiki\/Sed\">sed<\/a> for the first time. Well the first time where I have decided what the problem is and that the solution requires sed, and then using it.<\/p>\n<p>This is a big deal for me. I have been aware of sed, and awk for a log time. I have even used them either when advised by others or as part of scripts that I have run (but not written).<\/p>\n<p>This time, however, I can say it is all my own work. I have some data at work that I need to graph. There is too much to simply load into a spreadsheet, so I have to munge it a bit before I can use it. A simple perl program does that for me, and outputs a csv file that I can quickly load into a spreadsheet and make a graph. Once it I am happy that the data is correct, I then use <a href=\"http:\/\/www.gnuplot.info\/\">Gnuplot<\/a> to generate my final graphs. The problem is that gnuplot likes to have tab separated values, not comma separated. Here comes sed to the rescue.<\/p>\n<p><code>sed 's\/,\/\\t\/g' data.csv >data.txt<\/code><\/p>\n<p>Now that may not exactly be rocket science, but I very nearly wrote my own perl program to do that for me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think I have just used sed for the first time. Well the first time where I have decided what the problem is and that the solution requires sed, and then using it. This is a big deal for me. &hellip; <a href=\"https:\/\/stuphi.co.uk\/wordpress\/?p=75\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[39,40],"_links":{"self":[{"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/75"}],"collection":[{"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":0,"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"wp:attachment":[{"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stuphi.co.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}