Sort of, After the match of the phone number I want to add the new line so this wouldn't work because it would replace the phone number with new line:
perl -pi -e "s/(\d+)\s+\d+-\d\d\d\d)/\n/g"
Any other ideas?
I would like to add a new line after a match. I know I can edit a file doing a perl -pi -e "s/(\d+)\s+\d+-\d\d\d\d)//g" filename which this would replace the phone number with something but can I add a newline after my phone number or how would I do this in a script? The file is huge.
here's...
This is my initial start (main program).
The first sub I read a file in:
my %hash;
&read_file($moves); ##read file
In my read_file sub I get my data from my file then I put the data into the hash, which works I don't return the hash:
if (defined $_){$hash{$_}++;
----
Here is the sub to...
Looks like I am adding the same information in my hash when they should have different information. How do I just the the information I need?:
14014126,80321.1
14014126,80319.1
14014126,80172.1
13996815,81667.1
13996815,81630.1
13996815,81632.1
13996815,81678.1
13996815,81668.1
Here is my sub...
I am trying to get the lowest value from my dtt value. I have multiple mcc's. How can I achieve this? Here is my list:
MOD,MCC,DTT
13976465,80492.1, 65535
13976465,81402.1, 21600
13976417,80664.1, 65535
13976417,80431.1, 800
$hash{$key}{mcc}{$mcc}=$mcc;
$hash{$key}{mcc}{$mcc}{dtt}=$dtt;
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.