{"id":641,"date":"2023-03-03T03:53:45","date_gmt":"2023-03-03T03:53:45","guid":{"rendered":"https:\/\/www.toolkit.keywordfinder.us\/?page_id=641"},"modified":"2023-03-03T03:53:45","modified_gmt":"2023-03-03T03:53:45","slug":"remove-lines-containing-not-containing-tool","status":"publish","type":"page","link":"https:\/\/tools.billionsideas.com\/de\/remove-lines-containing-not-containing-tool\/","title":{"rendered":"Remove Lines Containing\/Not Containing"},"content":{"rendered":"<!DOCTYPE html>\n<html>\n<head>\n\t<title>Remove Lines Containing\/Not Containing<\/title>\n\t<meta charset=\"UTF-8\">\n\t<script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.6.0\/jquery.min.js\"><\/script>\n<\/head>\n<body>\n\t<h1>Remove Lines Containing\/Not Containing<\/h1>\n\t\n\t<div>\n\t\t<label for=\"option-upload\">Upload file:<\/label>\n\t\t<input type=\"file\" id=\"option-upload\" accept=\".txt\">\n\t<\/div>\n\t<br\/>\n\t<div>\n\t\t<label for=\"option-paste\">Or paste text here:<\/label>\n\t\t<textarea id=\"option-paste\"><\/textarea>\n\t<\/div>\n\t<br\/>\n\t<div>\n\t\t<label for=\"option-filter\">Filter:<\/label>\n\t\t<input type=\"text\" id=\"option-filter\">\n\t<\/div>\n\t<br\/>\n\t<div>\n\t\t<label for=\"option-lines\">Remove lines containing\/not containing filter:<\/label><br\/>\n\t\t<select id=\"option-lines\">\n\t\t\t<option value=\"containing\">Containing<\/option>\n\t\t\t<option value=\"not-containing\">Not Containing<\/option>\n\t\t<\/select>\n\t<\/div>\n\t<br\/>\n\t<div>\n\t\t<button id=\"btn-apply\">Apply<\/button>\n\t<\/div>\n\t<br\/>\n\t<div>\n\t\t<h2>Result:<\/h2>\n\t\t<textarea id=\"result\" readonly><\/textarea>\n\t\t<button id=\"btn-copy\">Copy<\/button>\n\t<\/div>\n\t\n\t<script>\n\t\t$(document).ready(function() {\n\t\t\t$('#btn-apply').on('click', function() {\n\t\t\t\tlet input = '';\n\t\t\t\tlet filter = $('#option-filter').val();\n\t\t\t\tlet linesToRemove = $('#option-lines').val();\n\t\t\t\t\n\t\t\t\tif ($('#option-upload')[0].files[0]) {\n\t\t\t\t\tlet fileReader = new FileReader();\n\t\t\t\t\t\n\t\t\t\t\tfileReader.onload = function(event) {\n\t\t\t\t\t\tinput = event.target.result;\n\t\t\t\t\t\tprocessInput(input, filter, linesToRemove);\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tfileReader.readAsText($('#option-upload')[0].files[0]);\n\t\t\t\t} else {\n\t\t\t\t\tinput = $('#option-paste').val();\n\t\t\t\t\tprocessInput(input, filter, linesToRemove);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t$('#btn-copy').on('click', function() {\n\t\t\t\t$('#result').select();\n\t\t\t\tdocument.execCommand('copy');\n\t\t\t});\n\t\t\t\n\t\t\tfunction processInput(input, filter, linesToRemove) {\n\t\t\t\tlet lines = input.split('\\n');\n\t\t\t\tlet output = '';\n\t\t\t\t\n\t\t\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\t\t\tif (linesToRemove === 'containing' &#038;&#038; lines[i].indexOf(filter) === -1) {\n\t\t\t\t\t\toutput += lines[i] + '\\n';\n\t\t\t\t\t} else if (linesToRemove === 'not-containing' &#038;&#038; lines[i].indexOf(filter) !== -1) {\n\t\t\t\t\t\toutput += lines[i] + '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('#result').val(output);\n\t\t\t}\n\t\t});\n\t<\/script>\n<\/body>\n<\/html>","protected":false},"excerpt":{"rendered":"<p>Remove Lines Containing\/Not Containing Remove Lines Containing\/Not Containing Upload file: Or paste text here: Filter: Remove lines containing\/not containing filter: ContainingNot Containing Apply Result: Copy<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","footnotes":""},"class_list":["post-641","page","type-page","status-publish"],"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"Billions Ideas","author_link":"https:\/\/tools.billionsideas.com\/de\/author\/loginbillionsideas-com\/"},"comment_info":0,"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/pages\/641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/comments?post=641"}],"version-history":[{"count":0,"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/pages\/641\/revisions"}],"wp:attachment":[{"href":"https:\/\/tools.billionsideas.com\/de\/wp-json\/wp\/v2\/media?parent=641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}