When data is put into a .txt file, how do you manipulate it and then output it? (If you're wanting to average some items, or add others, etc. once they're entered into the file.)
kahaj
0
Junior Poster
Recommended Answers
Jump to Postread the file however you want, get the data you want into variables and use the appropriate operators to do the data munging. Where are you stuck?
Jump to PostI suggest you use a single line to hold all the data:
#save to file open(OUTFILE, ">>","nflStats.txt") or die "Error opening nflStats.txt $!, stopped"; print OUTFILE join(':::', $whichWeek, $whereAt, $yourTmScore, $otherTmScore, $passYrdPGame, $rushYrdPGame, $sacks, $sacksAllowed, $turnovForcedPerGame, $turnovAllowedPGame, $tds, $tdsAllowed), "\n"; close(OUTFILE);
Then you open the file and …
All 6 Replies
KevinADC
192
Practically a Posting Shark
kahaj
0
Junior Poster
KevinADC
192
Practically a Posting Shark
kahaj
0
Junior Poster
kahaj
0
Junior Poster
KevinADC
192
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.