...

View Full Version : i need to remove all lines containing text from each line in downloaded.txt....



kizm0
06-21-2009, 08:22 AM
i need to remove all lines containing text from each line in downloaded.txt from the file download.txt.


So I have a function Remcon.

I need Remstr = to every line of downloaded.txt , and text ill fix my self.

function remcon()
{

var text = document.form_rli.input_output.value;
var remstr = "";
var addstr = document.form_rli.to_add.value;
var count = 0;
if (addstr.length > 0) addstr = addstr + '\n'; else addstr = '';
if (addstr.length > 0) counttype = ' lines were replaced.'; else counttype = ' lines were removed.';
var textout = new Array();
text = text.replace(/\r/g,'');
text = text.split('\n');
if (remstr.length == '0') remstr = '___EMPTY_INPUT___';
for (var x = 0; x < text.length; x++){
if (document.form_rli.case_sen.checked == false) if (text[x].toLowerCase().indexOf(remstr.toLowerCase()) == -1) textout[x] = text[x]; else {textout[x] = addstr + "___ARRAY_REMOVED___"; count++;}
if (document.form_rli.case_sen.checked == true) if (text[x].indexOf(remstr) == -1) textout[x] = text[x]; else {textout[x] = addstr + "___ARRAY_REMOVED___"; count++;}}
textout = textout.join('\n');
textout = textout.replace(/___ARRAY_REMOVED___\n/g,'');
textout = textout.replace(/\n___ARRAY_REMOVED___/g,'');
textout = textout.replace(/___ARRAY_REMOVED___/g,'');
document.form_rli.input_output.value = textout;
document.getElementById('removed').innerHTML = count + counttype;
}

Philip M
06-21-2009, 09:34 AM
i need to remove all lines containing text from each line in downloaded.txt from the file download.txt.


Er, don't all the lines in download.txt contain well, er, text? :confused:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum