{"id":757,"date":"2023-11-20T19:26:53","date_gmt":"2023-11-20T13:56:53","guid":{"rendered":"https:\/\/www.cyberaka.com\/?p=757"},"modified":"2023-11-20T19:52:55","modified_gmt":"2023-11-20T14:22:55","slug":"converting-chrome-har-file-to-csv","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=757","title":{"rendered":"Converting Chrome HAR file to CSV"},"content":{"rendered":"\n<p>It is sometimes easier to export a chrome har file into CSV format so that it can be opened in Excel. Once opened in Excel it is really easy to do further analysis for rather very large har dumps. <\/p>\n\n\n\n<p>The following solution is based on this Link: https:\/\/stackoverflow.com\/questions\/31648078\/how-to-import-har-file-to-excel<\/p>\n\n\n\n<p>Install jq on Mac. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install jq<\/code><\/pre>\n\n\n\n<p>Run this command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat some_file.har | jq '&#91; \"URL\", \"Time\", \"Wait time\", \"Status\", \"Body size\",\"Content-Type\", \"Content-Encoding\"],\n    (.log.entries&#91;] | &#91;\n        .request.url,\n        .time,\n        .timings.wait,\n        .response.status,\n        .response.content.size,\n        .response.content.mimeType,\n        .response.content.encoding\n]) | @csv' | sed 's\/\\\\\"\/\/g' | sed 's\/\"\/\/g' &gt; some_file.csv<\/code><\/pre>\n\n\n\n<p>This results in a CSV file which you can easily open in an Excel. <\/p>\n\n\n\n<p>To extract the path of the URL minus the file name the following Excel function can be used by adding a column:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>=LEFT(A2,LEN(A2)-LEN(RIGHT(A2,LEN(A2)-FIND(\"@\",SUBSTITUTE(A2,\"\/\",\"@\",LEN(A2)-LEN(SUBSTITUTE(A2,\"\/\",\"\"))),1))))<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is sometimes easier to export a chrome har file into CSV format so that it can be opened in Excel. Once opened in Excel it is really easy to do further analysis for rather very large har dumps. The following solution is based on this Link: https:\/\/stackoverflow.com\/questions\/31648078\/how-to-import-har-file-to-excel Install jq on Mac. Run this command. [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[83,82],"tags":[],"class_list":["post-757","post","type-post","status-publish","format-standard","hentry","category-chrome","category-excel"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=757"}],"version-history":[{"count":2,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/757\/revisions"}],"predecessor-version":[{"id":760,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/757\/revisions\/760"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}