{"id":39506,"date":"2023-05-25T14:45:49","date_gmt":"2023-05-25T18:45:49","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=39506"},"modified":"2023-05-26T07:55:20","modified_gmt":"2023-05-26T11:55:20","slug":"viewing-large-text-files","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/05\/25\/viewing-large-text-files\/","title":{"rendered":"Viewing Large Text Files"},"content":{"rendered":"<p>I recently needed to view and search a 20 GB log file and realized that I don&rsquo;t know of any Mac text editors that are disk-based, i.e. that don&rsquo;t load the entire file into RAM. Wikipedia has <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_text_editors#Extra_features\">a list<\/a> of editors with Large File Support, but it seems to be more about not having artificial RAM limits rather than supporting files that don&rsquo;t fit in memory.<\/p>\n\n<p>What I ended up doing in the moment, because I knew it would work, was to use <code>split<\/code> to break the file into smaller chunks. I then did a multi-file search with <a href=\"https:\/\/www.barebones.com\/products\/bbedit\/\">BBEdit<\/a>.<\/p>\n\n<p>I considered <a href=\"https:\/\/hexfiend.com\">Hex Fiend<\/a>, which <em>is<\/em> disk-based. It&rsquo;s fast and has a find feature, but it&rsquo;s less than ideal for this use case because it doesn&rsquo;t support UTF-8 or show line breaks.<\/p>\n\n<p>For short tasks in the future, I will probably use <code>less<\/code>, because it can directly open and search large UTF-8 files. But for longer tasks I don&rsquo;t want to be working in Terminal.<\/p>","protected":false},"excerpt":{"rendered":"<p>I recently needed to view and search a 20 GB log file and realized that I don&rsquo;t know of any Mac text editors that are disk-based, i.e. that don&rsquo;t load the entire file into RAM. Wikipedia has a list of editors with Large File Support, but it seems to be more about not having artificial [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-05-25T18:45:51Z","apple_news_api_id":"1a29906a-44ee-436f-9545-4100472e0608","apple_news_api_modified_at":"2023-05-26T11:55:23Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AGimQakTuQ2-VRUEARy4GCA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[154,75,124,2391,2390,30,2223,68],"class_list":["post-39506","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bbedit","tag-developertool","tag-emacs","tag-glogg","tag-hex-fiend","tag-mac","tag-macos-13-ventura","tag-texteditor"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=39506"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39506\/revisions"}],"predecessor-version":[{"id":39507,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39506\/revisions\/39507"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=39506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=39506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=39506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}