i am an newbie and try to learn perl. Now i have done my first script an have one problem with a lot of space lines between the text-lines. How can i remove this space-lines
in this file.
How are you writing the text to the file? It would probably be easiest to skip writing the blank lines in the first place, rather than editing them out of a file that you created. What does your script look like? Post some code and people will be glad to help.
open (SOURCE, "<$shotech");
open (DESTINATION, ">>$vlanports");
@serial=<SOURCE>;
for (@serial, SOURCE){
if (/vlan \d+ ports add /){ # Hier wird angegeben nach was gesucht werden soll und in die Datei geschrieben wird
$_=~s/member portmember$//;
$_=~s/[1-8]\/.[-, ]//g;
$_=~s/^vlan \d+ ports add $//;
$_=~s/^$/!/;
$_=~tr/!//d; # Hier werden die nicht benötigten Ports herausgefiltert.
$_=~s/vlan /config vlan /g;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.