I could use some real expert help here..
I have only the basic - no add-on modules except what comes with Perl

What is needed, Is this possible with Perl 5.x..  

read from file olddata.txt output to newdata.txt

1) output all numerics inside parenthesis to negative values e.g., (32)
should output as -32
2) output all numerics inside double quotes to the number inside the
quotes without the comma e.g., "2,345" should be output as 2345
3) ignore (do not output) lines with alphabet characters A-Za-z
4) ignore (do not output) lines with only commas
5) ignore (do not output) the first and last column of the line
6) print out data as one data value per line preceeded by an index
starting at 1, from top of column one to bottom of column one, then
column two (top to bottom), etc.

Thanks for any help....

here is the file:

My Lake,,,,,,,,,,,,,
**Inflow,,,,,,,,,,,,,
( Date: 2007 ),,,,,,,,,,,,,
,,,,,,,,,,,,,
Day,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,Total
1,74 ,43 ,3 ,"2,209 ","1,734 ",774 ,"2,306 ","1,589 ",968 ,,,,
2,74 ,114 ,114 ,"2,059 ","1,618 ",920 ,"2,368 ","1,859 ",976 ,,,,
3,3 ,3 ,(32),"2,202 ",935 ,"1,026 ","2,382 ","1,746 ","1,008 ",,,,
4,3 ,3 ,3 ,"2,064 ","1,061 ",675 ,"2,714 ","1,616 ","1,024 ",,,,
5,114 ,43 ,38 ,"2,088 ","1,336 ",839 ,"2,271 ","1,623 ",573 ,,,,
6,79 ,3 ,43 ,"2,770 ","1,058 ",727 ,"2,402 ","1,735 ","1,316 ",,,,
7,3 ,3 ,142 ,"2,228 ","1,031 ","1,046 ","2,427 ","1,746 ",984 ,,,,
8,38 ,38 ,(168),"2,265 ","1,303 ","1,120 ","2,479 ","1,417 ","1,046
",,,,
9,3 ,3 ,41 ,"2,333 ","1,051 ","1,253 ","2,397 ","1,279 ",984 ,,,,
10,(32),43 ,(492),"2,270 ",987 ,"1,213 ","2,680 ",828 ,"1,288 ",,,,
11,38 ,38 ,133 ,"2,024 ",820 ,"1,268 ","2,344 ","1,001 ",,,,,
12,38 ,38 ,375 ,"2,175 ",840 ,"1,313 ","1,953 ","1,466 ",,,,,
13,3 ,43 ,803 ,"1,836 ",821 ,"1,390 ","1,948 ","1,028 ",,,,,
14,38 ,38 ,842 ,"1,872 ",884 ,"1,341 ","1,962 ","1,275 ",,,,,
15,3 ,43 ,768 ,"1,880 ",845 ,"1,198 ","1,992 ","1,236 ",,,,,
16,43 ,3 ,837 ,"2,417 ",969 ,"1,549 ","1,897 ","1,049 ",,,,,
17,38 ,3 ,950 ,"2,674 ",936 ,"1,557 ","2,284 ","1,278 ",,,,,
18,3 ,3 ,"1,274 ","2,324 ",860 ,"1,519 ","1,896 ","1,225 ",,,,,
19,38 ,3 ,517 ,"1,722 ",906 ,"1,554 ","1,871 ","1,095 ",,,,,
20,43 ,3 ,796 ,"1,537 ",823 ,"1,478 ","1,569 ","1,352 ",,,,,
21,74 ,3 ,876 ,"1,494 ","1,466 ","1,476 ","1,751 ",918 ,,,,,
22,190 ,43 ,"1,043 ","1,493 ","3,322 ","1,517 ","1,612 ","1,155 ",,,,,
23,3 ,79 ,"1,187 ","1,827 ","1,963 ","1,614 ","1,610 ","1,112 ",,,,,
24,38 ,79 ,"1,625 ","1,836 ",676 ,"1,538 ","1,661 ","1,471 ",,,,,
25,3 ,(73),"1,501 ","1,304 ",759 ,"1,213 ","1,583 ","1,297 ",,,,,
26,43 ,38 ,"1,613 ","1,314 ","1,105 ","1,188 ","1,856 ","1,228 ",,,,,
27,3 ,3 ,"1,820 ","1,532 ",58 ,"1,383 ","1,435 ","1,339 ",,,,,
28,38 ,43 ,"1,972 ","1,601 ",76 ,872 ,"1,615 ",941 ,,,,,
29,43 ,,"1,918 ","1,566 ",218 ,"1,310 ","1,709 ",992 ,,,,,
30,38 ,,"1,969 ","1,601 ",497 ,"2,300 ","1,661 ",987 ,,,,,
31,38 ,,"2,173 ",,986 ,,"1,964 ",896 ,,,,,
,,,,,,,,,,,,,
TOTAL SFD,"1,157 ",729 ,"24,685 ","58,516 ","31,946 ","38,175 ","62,598
","39,779 ","10,168 ",,,,"267,754 "
TOTAL AF,"2,294 ","1,447 ","48,950 ","116,037 ","63,350 ","75,700
","124,132 ","78,882 ","20,163 ",,,,"530,955 "
,,,,,,,,,,,,,
AVE SFD,37 ,26 ,796 ,"1,951 ","1,031 ","1,272 ","2,019 ","1,283
","1,017 ",,,,"1,048 "
MAX SFD,190 ,114 ,"2,173 ","2,770 ","3,322 ","2,300 ","2,714 ","1,859
","1,316 ",,,,"3,322 "
MIN SFD,(32),(73),(492),"1,304 ",58 ,675 ,"1,435 ",828 ,573 ,,,,(492)




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to