in reply to Re: updating/modifying line in a file
in thread updating/modifying line in a file
i checked the userlist.txt its like this after this: kevin:12345678: dex:12345678:11955436 brandon:12345678:kevin:12345678:12348kevin:12345678:134kevin:12345678:135open(data,"userlist.txt") or di +e "$@"; while ($line = <data>) { @details = split(/:/,$l +ine); if ($name[0] eq $detail +s[0]) { print "check -----> $de +tails[0] , $details[1] ,$downloadTotal \n"; open(FH, ">download +temp.txt") or die "$@"; print "check 2 ---- +-> $details"; print(FH $downloadT +otal); open(FH,">>userlis +t.txt") or die "$@"; $details[2] = $ det +ails[2] + $downloadTotal; $newline = $details +[0].':'.$details[1].':'.$details[2]; print(FH $newline); + }
|
|---|