#!/usr/bin/perl -w # perl p_pajek_setThreshold.pl print("Enter Input File Name: "); $filein = ; print("Enter Threshold Value: "); $threshold = ; print("Enter Output File Name: "); $fileout = ; #open(IN, "$ARGV[0]"); open(IN, "$filein"); @data = ; close(IN); @newdata = (); $tmp = ""; #$threshold = $ARGV[1]; foreach(@data) { chomp($_); $ctr++; print "CTR> $ctr\n"; @array = split(" ", $_); foreach $array(@array) { if ($array <= $threshold) { $array = 0; $tmp .= "$array "; }else { $tmp .= "$array "; } } push(@newdata, $tmp); $tmp = ""; } print "Printing Output File : $fileout\n"; open(OUT, ">$fileout"); foreach(@newdata) { print OUT"$_\n"; } close(OUT);