remove-end-of-line

This program opens v1.txt. Then it will check every line for the keyword rt7w. It will remove the word rt7w and everything what comes after it. Then it will print the result in to the file v2.txt. For example you have a list of urls with descriptions (http://www.domain.com/ here is the description). Then it will print only http://www.domain.com/ (if you change the entry rt7w into here). You can even edit the number 0 (if you want to delete the beginning for example the a href= part).

 

open (ERSTE, "v1.txt") || die "Datei3 nicht gefunden\n";

@urls = <ERSTE>;
close (ERSTE);

open (KEYWORD, ">v2.txt");

for(@urls)
{
chop $_;
$Stop = index($_,"rt7w");

# removes everything after the keyword rt7w

$Domain = substr($_,0,$Stop);
print KEYWORD "$Domain\n";


$i++;
}

close (KEYWORD);



 

 

Back to previous page

  Get Free Autoresponder

Enter your email address below and you will receive a powerful Autoresponder and our Special Ezine for free:

(Please use your real email address or else you won't receive the free script)

Name: *
Email: *

Or you can subscribe by clicking this link to send an email automatically:

mailto:amlmEzine@DrQuek.com