{"id":3221,"date":"2023-11-11T11:06:33","date_gmt":"2023-11-11T20:06:33","guid":{"rendered":"https:\/\/crm270s.wordpress.com\/?p=3221"},"modified":"2023-11-11T11:06:33","modified_gmt":"2023-11-11T20:06:33","slug":"%ec%9b%b9-%ec%97%b0%eb%b3%80-%ed%95%9c%ea%b5%ad-codes","status":"publish","type":"post","link":"https:\/\/crm270s.mycpamytax.com\/?p=3221","title":{"rendered":"\uc6f9 (\uc5f0\ubcc0 &#8211; \ud55c\uad6d) codes"},"content":{"rendered":"\n<p class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background has-link-color wp-elements-1 wp-block-paragraph\"><strong>business_type_update.pl<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/perl\n\nuse strict;\nuse warnings;\n\n# Input file\nmy $input_file = 'business_type_original.txt';\n\n# Output file\nmy $output_file = 'business_type_replaced.txt';\n\n# Open the input file for reading\nopen my $input_fh, '&lt;', $input_file or die \"Cannot open input file '$input_file': $!\";\n\n# Open the output file for writing\nopen my $output_fh, '&gt;', $output_file or die \"Cannot open output file '$output_file': $!\";\n\n# Process each line of the input file\nwhile (my $line = &lt;$input_fh&gt;) {\n    # Replace \"\uc774\uc0bf\uc9d0\" with \"\uce58\uacfc\" in the line\n    $line =~ s\/\uc774\uc0bf\uc9d0\/\ud68c\uacc4 \uc0ac\ubb34\uc2e4\/g;\n\n    # Write the modified line to the output file\n    print $output_fh $line;\n}\n\n# Close the input and output files\nclose $input_fh;\nclose $output_fh;\n\nprint \"Replacement complete. Results saved in '$output_file'\\n\";<\/code><\/pre>\n\n\n\n<p class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background has-link-color wp-elements-2 wp-block-paragraph\"><strong>sqlitecodes.txt<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select '\"' || field1 || '\",' from business_type_replaced order by field1 desc<\/code><\/pre>\n\n\n\n<p class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background has-link-color wp-elements-3 wp-block-paragraph\"><strong>moving_seoul.html<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;title&gt;Open Search Words in Reverse Order&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;script&gt;\n        var searchWords = &#091;\n\"\uc774\uc0bf\uc9d0 \uc911\ub791\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc911\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc885\ub85c\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc740\ud3c9\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc6a9\uc0b0\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc601\ub4f1\ud3ec\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc591\ucc9c\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc1a1\ud30c\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc131\ubd81\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc131\ub3d9\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc11c\ucd08\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uc11c\ub300\ubb38\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \ub9c8\ud3ec\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \ub3d9\uc791\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \ub3d9\ub300\ubb38\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \ub3c4\ubd09\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \ub178\uc6d0\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uae08\ucc9c\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uad6c\ub85c\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uad11\uc9c4\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uad00\uc545\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uac15\uc11c\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uac15\ubd81\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uac15\ub3d9\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\",\n\"\uc774\uc0bf\uc9d0 \uac15\ub0a8\uad6c \uc11c\uc6b8\ud2b9\ubcc4\uc2dc\"\n        ];\n\n        for (var i = 0; i &lt; Math.min(25, searchWords.length); i++) {\n            window.open(\"https:\/\/www.google.com\/search?q=\" + encodeURIComponent(searchWords&#091;i]), \"_blank\");\n        }\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n\n\n\n<\/code><\/pre>\n\n\n\n<p class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background has-link-color wp-elements-4 wp-block-paragraph\"><strong>firefox_02.pl<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use strict;\nuse warnings;\n\n# Initialize an array to store extracted content\nmy @extracted_content;\n\n# Process each HTML file (1.html to 25.html)\nfor my $file_number (1..25) {\n    my $input_file = \"${file_number}.html\";\n\n    # Open the current input file for reading\n    open my $input_fh, '&lt;', $input_file or warn \"Cannot open input file '$input_file': $!\";\n\n    # Read each line and look for URLs and +82 content\n    while (my $line = &lt;$input_fh&gt;) {\n        chomp $line;\n\n        # Extract URLs matching \/https:\\\/\\\/www\\.google\\.com\\\/maps\\\/place\/\n        if ($line =~ \/https:\\\/\\\/www.google.com\\\/maps\\\/place\/) {\n            # Remove leading '&lt;' and trailing '&gt;'\n            $line =~ s\/^&lt;(.+)&gt;$\/$1\/;\n            push @extracted_content, \"$input_file\\t$line\";  # Use a tab character as the delimiter\n        }\n\n        # Extract content starting with +82 and going to the end of the line\n        if ($line =~ \/\\+82(.+)\/) {\n            my $plus82_content = \"+82$1\";  # Include +82 in the extracted content\n            push @extracted_content, \"$input_file\\t$plus82_content\";  # Use a tab character as the delimiter\n        }\n    }\n\n    # Close the current input file\n    close $input_fh;\n}\n\n# Save the extracted content to a file\nmy $output_file = 'firefox_02.txt';\nopen my $output_fh, '&gt;', $output_file or die \"Cannot open output file '$output_file': $!\";\nforeach my $entry (@extracted_content) {\n    print $output_fh \"$entry\\n\";\n}\nclose $output_fh;\n\nprint \"Extraction complete. Extracted content is saved in '$output_file'\\n\";\n<\/code><\/pre>\n\n\n\n<p class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background has-link-color wp-elements-5 wp-block-paragraph\"><strong>firefox_website_02.pl<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use strict;\nuse warnings;\n\n# Initialize variables to store extracted URLs\nmy @google_maps_urls;\n\n# Process each HTML file (1.html to 25.html)\nfor my $file_number (1..25) {\n    my $input_file = \"${file_number}.html\";\n\n    # Open the current input file for reading\n    open my $input_fh, '&lt;', $input_file or warn \"Cannot open input file '$input_file': $!\";\n\n    my $previous_line = '';\n    my $current_line = '';\n    my $extracting = 0;\n\n    # Read each line and look for URLs\n    while (my $line = &lt;$input_fh&gt;) {\n        chomp $line;\n\n        # Check if the current line contains \"+82\"\n        if ($current_line =~ \/\\+82\/) {\n            # Check if the next line contains \"Website\"\n            if ($line =~ \/Website\/) {\n                $extracting = 1;\n                push @google_maps_urls, \"$input_file, $current_line\";\n            }\n        }\n\n        # Continue extracting 3 more lines if we're in an extraction state\n        if ($extracting) {\n            push @google_maps_urls, \"$input_file, $line\";\n            if (@google_maps_urls % 4 == 0) {\n                $extracting = 0;\n            }\n        }\n\n        # Store the current line for the next iteration\n        $previous_line = $current_line;\n        $current_line = $line;\n    }\n\n    # Close the current input file\n    close $input_fh;\n}\n\n# Save the extracted URLs to a file\nmy $output_file = 'firefox_website_02.txt';\nopen my $output_fh, '&gt;', $output_file or die \"Cannot open output file '$output_file': $!\";\n\nforeach my $url (@google_maps_urls) {\n    print $output_fh \"$url\\n\";\n}\n\n# Close the output file\nclose $output_fh;\n\nprint \"Extraction complete. Extracted 4 lines (including +82 and Website) are saved in '$output_file'\\n\";\n\n<\/code><\/pre>\n\n\n\n<p class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background has-link-color wp-elements-6 wp-block-paragraph\"><strong>sqlitecodes.txt<\/strong><\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background wp-block-paragraph\"><strong>82.txt<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT\n    field1, field2,\n    CASE\n        WHEN INSTR(field2, '+82') &gt; 0 THEN\n            SUBSTR(field2, INSTR(field2, '+82'))\n        ELSE\n            field2\n    END AS extracted_value\nFROM firefox_website_02;\n<\/code><\/pre>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background wp-block-paragraph\"><strong>http.txt<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT\n    extracted_value, field1, field2,\n    CASE\n        WHEN field2 LIKE '&lt;%' AND field2 LIKE '%&gt;' THEN\n            SUBSTR(field2, INSTR(field2, '&lt;') + 1, INSTR(field2, '&gt;') - INSTR(field2, '&lt;') - 1)\n        WHEN field2 LIKE '&lt;%' THEN\n            'Starts with &lt;, but missing &gt;'\n        ELSE\n            'Does not start with &lt;'\n    END AS extracted_value\nFROM firefox_website_02_PHONE;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>business_type_update.pl sqlitecodes.txt moving_seoul.html firefox_02.pl firefox_website_02.pl sqlitecodes.txt 82.txt http.txt<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[26],"tags":[],"class_list":["post-3221","post","type-post","status-publish","format-standard","hentry","category-codes"],"_links":{"self":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts\/3221","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=3221"}],"version-history":[{"count":0,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts\/3221\/revisions"}],"wp:attachment":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}