looping problem
- From: mquiqui@xxxxxxxxx
- Date: 31 Aug 2006 02:00:01 -0700
hoi people,
i just starting to write with perl and have a problem i can't solve.
i hope someone can help me.
mine program is somekind of a mathematical solver.
my program works as follows.
a user gives 7 $ARGV ( numeric).
then these argument run in a for loop. the outcome is then exported to
an txt.file as a table.
( so far this works great).
example of mine table:
x1 x2 Ra Rb Rc Mm
================================================================================
0.0 -5.0 -10.00 0.00 0.00 0.00
1.0 -4.0 -9.38 -0.75 0.12 2.49
2.0 -3.0 -8.75 -1.49 0.25 4.95
3.0 -2.0 -8.13 -2.23 0.37 7.33
4.0 -1.0 -7.52 -2.96 0.48 9.60
5.0 0.0 -16.91 -3.67 0.59 11.72
6.0 1.0 -15.69 -5.11 0.81 16.14
7.0 2.0 -14.48 -6.53 1.02 20.31
8.0 3.0 -13.29 -7.91 1.21 24.13
9.0 4.0 -12.12 -9.25 1.38 27.54
10.0 5.0 -10.98 -10.55 1.52 30.47
this is the tricky part i can't solve.
every colom as you can see above.(x1,x2,ra,rb,rc,mm).
has to be used in a loop, line by line.
when the loop is done it has to read al of the second row values.
and run it again in the loop.
..
i have tried some different thing put it does not work.
i have put an extra for loop statement at the beginning. this gave me
the loop values (xs) as i expexted but, it repeats al of the table
values to.
x1 x2 xs Ra Rb Rc MM
================================================================================
0.0 -5.0 0.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 5.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 10.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 15.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 20.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 25.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 30.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 35.00 | -10.00 0.00 0.00
0.00
5.0 0.0 0.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 5.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 10.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 15.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 20.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 25.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 30.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 35.00 | -14.38 -5.94 0.31
6.25
the values of (x1,x2,ra,rb,rc,mm) has to be used and printed one time.
for example:
the values of (x1.x2,ra,rb,rc,mm) are put in an array separetly and
then put in an formula that uses al of the values from the (xs) loop.
when this loop is done. it has to reas the second line values and put
in the same loop.
i hope some can help me with finding a method to solve this.
thanks,
.
- Prev by Date: CORE DUMP by script !!
- Next by Date: Reading whole file with while(INPUT) but I need to access each line
- Previous by thread: CORE DUMP by script !!
- Next by thread: Reading whole file with while(INPUT) but I need to access each line
- Index(es):
Relevant Pages
|
|