codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Calculating average from a file input and generating output in another file  hardik.mehta.b at 16:58 on Friday, January 21, 2011
 

Hi,

I am new to perl programming and have a task at hand. I would be very thankful if anyone can help me solve the problem.

I have a file which has data in the format given below

abc.com, 2, 4, 5
xyz.com, 1, 2, 6
efg.net, 7, 3, 6

abc.com, 5, 3, 7
xyz.com, 1, 2, 1
efg.net, 3, 3, 2

abc.com, 2, 4, 5
xyz.com, 1, 2, 6
efg.net, 7, 3, 6

abc.com, 2, 4, 5
xyz.com, 1, 2, 6
efg.net, 7, 3, 6

Here the numbers after the urls (abc.com, xyz.com, efg.net) are ranks/positions of respective urls in bing, google, yahoo search engines when the script is run 4 times.

Now I need a code that reads the sample input file (please see attachment) and generates another file with the average of each url in the following format

abc.com, 2.75, 3.75, 5.5
xyz.com, 1, 2, 4.75
efg.net, 6, 3, 5

I need to carry out an important task based on the generated output and I have strict deadlines to meet.

Any help is appreciated..

Thanks in Advance,
Hardik








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Session info
•  Re: table within a table with wrapping text
•  Cookies - i have a hard time with them
•  Codefest`11
•  Re: MS Access connection in JSP
•  Re: horizontal scroll bar for drop down list box
•  Re: Help with 2 level tab menu
•  Web design chennai
•  Calculating average from a file input and generating output in another file


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011