{"id":2842,"date":"2011-11-18T02:51:38","date_gmt":"2011-11-18T08:51:38","guid":{"rendered":"http:\/\/humairahmed.com\/blog\/?p=2842"},"modified":"2011-11-18T02:52:32","modified_gmt":"2011-11-18T08:52:32","slug":"perl-merging-files","status":"publish","type":"post","link":"https:\/\/humairahmed.com\/blog\/?p=2842","title":{"rendered":"Perl &#8211; merging files"},"content":{"rendered":"<div class=\"twttr_buttons\"><div class=\"twttr_twitter\">\n\t\t\t\t\t<a href=\"http:\/\/twitter.com\/share?text=Perl+-+merging+files\" class=\"twitter-share-button\" data-via=\"\" data-hashtags=\"\"  data-size=\"default\" data-url=\"https:\/\/humairahmed.com\/blog\/?p=2842\"  data-related=\"\" target=\"_blank\">Tweet<\/a>\n\t\t\t\t<\/div><\/div><p>Below I demonstrate a quick method of merging two files into a third file using Perl. The program merges two files together into a third file by writing one line from file one to file three and then writing one line from file two to file three; this pattern is then repeated until all contents from both file one and file two<br \/>\nhave been written to file three. <!--more--><br \/>\n<div id=\"attachment_2843\" style=\"width: 585px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/humairahmed.com\/blog\/wp-content\/uploads\/2011\/11\/perl_merge_output-e1321606108313.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2843\" src=\"http:\/\/humairahmed.com\/blog\/wp-content\/uploads\/2011\/11\/perl_merge_output-e1321606108313.png\" alt=\"Merging two files with Perl\" title=\"Merging two files with Perl\" width=\"575\" height=\"486\" class=\"size-full wp-image-2843\" \/><\/a><p id=\"caption-attachment-2843\" class=\"wp-caption-text\">Merging two files with Perl<\/p><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below I demonstrate a quick method of merging two files into a third file using Perl. The program merges two files together into a third file by writing one line from file one to file three and then writing one &hellip; <a href=\"https:\/\/humairahmed.com\/blog\/?p=2842\">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":{"footnotes":""},"categories":[382,5],"tags":[723,720,722,721,386,567],"class_list":["post-2842","post","type-post","status-publish","format-standard","hentry","category-perl","category-programming","tag-combine-files","tag-file-merge","tag-merge-two-files","tag-merging-files","tag-perl-2","tag-perl-code"],"_links":{"self":[{"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2842"}],"version-history":[{"count":4,"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2842\/revisions"}],"predecessor-version":[{"id":2847,"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2842\/revisions\/2847"}],"wp:attachment":[{"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humairahmed.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}