Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 21st, 2012, 03:20 AM
vahidperl vahidperl is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 1 vahidperl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m
Reputation Power: 0
Search in a list

Hi everyone,

I need to write a program to search within a list for a specific number and write the result as output in a text file.


This is my list that I want to search within it

Score1----Score2----Start------End
-4.3 ------24-------- 96----------205
-2.01-----12---------145---------210
3---------31---------180---------240
7---------14---------200---------250
...--------...----------...----------...
...--------...----------...----------...
...--------...----------...----------...


I need a program to do the following action:
If a number (96 to 250) fall between start and end values, the program get the score1 and divide it by the score2 and write the result for that number in a text file. But if a number fall in more than one row for example number 185 present in row 1 (96-205) row 2 (145-205) and row 3 (180-240) it produce the average value. For example for number 185 the output value would be ((-4.3/24)+(-2.01/31)+(3/31) )/3

Could you help me please?

Reply With Quote
  #2  
Old September 21st, 2012, 11:39 AM
Laurent_R Laurent_R is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2012
Posts: 504 Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 4 Days 18 h 54 m 49 sec
Reputation Power: 385
Hi,
you have received an answer in your cross-post on the Perl Guru forum.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Search in a list

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap