{"id":3658,"date":"2024-02-23T21:08:50","date_gmt":"2024-02-24T06:08:50","guid":{"rendered":"https:\/\/crm270s.abramjmeister.com\/?p=3658"},"modified":"2024-02-23T21:08:50","modified_gmt":"2024-02-24T06:08:50","slug":"combine-pl","status":"publish","type":"post","link":"https:\/\/crm270s.mycpamytax.com\/?p=3658","title":{"rendered":"combine.pl"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">combines final parses txt files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/perl\n\nuse strict;\nuse warnings;\nuse File::Spec;\n\n# Get the current directory\nmy $folder_path = File::Spec->rel2abs('.');\n\n# Specify the output file name\nmy $output_file = 'combined_output.txt';\n\n# Clear the contents of the output file before writing\nopen(my $clear_fh, '>', $output_file) or die \"Cannot open $output_file for writing: $!\";\nclose($clear_fh);\n\n# Open the output file for appending\nopen(my $out_fh, '>>', $output_file) or die \"Cannot open $output_file for appending: $!\";\n\n# List of specific files to combine\nmy @files_to_combine = qw(bizname_semi_values.txt bizname_semi_values_6.txt bizname_semi_values_11.txt );\n\n# Iterate through each specified file, read its content, and append to the output file\nforeach my $file (@files_to_combine) {\n    my $file_path = \"$folder_path\/$file\";\n    open(my $in_fh, '&lt;', $file_path) or die \"Cannot open $file_path for reading: $!\";\n    # Read file content in larger chunks (4KB)\n    while (my $bytes_read = read($in_fh, my $buffer, 4096)) {\n        print $out_fh $buffer;\n    }\n    close($in_fh);\n}\n\n# Close the output file\nclose($out_fh);\n\nprint \"Combined specified text files into $output_file\\n\";\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>combines final parses txt files:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[26],"tags":[],"class_list":["post-3658","post","type-post","status-publish","format-standard","hentry","category-codes"],"_links":{"self":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts\/3658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3658"}],"version-history":[{"count":0,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts\/3658\/revisions"}],"wp:attachment":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}