W
walala
Dear all,
I have been learning Perl for several days by reading online tutorials...
now when I really need it to some serious work, I found I still have a bunch
of questions:
1. How to make a string all to "UPPER CASE"?
2. Suppose there is a "(" (bracket character) in the string $str, and I want
to remove it, how can I do that?
3. Suppose there are two lines in my text file:
M1834 S_4 47 52 VDD! PCH L=239.99999143598E-9 W=3.99999998990097E-6 \
AD=2.04320002757108E-12 AS=1.58200004745507E-12 PD=5.36000015927129E-6 \
PS=829.999976303952E-9 NRD=+2.50000001E-01 NRS=+2.50000001E-01 M=1.0
I want to change the "\ ^n" ( The "\" plus an "LF" at the end of each line)
to "^n +" (first do an "LF", then add a "+" to the front of each line)
The result is:
M1834 S_4 47 52 VDD! PCH L=239.99999143598E-9 W=3.99999998990097E-6
+AD=2.04320002757108E-12 AS=1.58200004745507E-12 PD=5.36000015927129E-6
+PS=829.999976303952E-9 NRD=+2.50000001E-01 NRS=+2.50000001E-01 M=1.0
How can I do that?
Thanks a lot,
-Walala
I have been learning Perl for several days by reading online tutorials...
now when I really need it to some serious work, I found I still have a bunch
of questions:
1. How to make a string all to "UPPER CASE"?
2. Suppose there is a "(" (bracket character) in the string $str, and I want
to remove it, how can I do that?
3. Suppose there are two lines in my text file:
M1834 S_4 47 52 VDD! PCH L=239.99999143598E-9 W=3.99999998990097E-6 \
AD=2.04320002757108E-12 AS=1.58200004745507E-12 PD=5.36000015927129E-6 \
PS=829.999976303952E-9 NRD=+2.50000001E-01 NRS=+2.50000001E-01 M=1.0
I want to change the "\ ^n" ( The "\" plus an "LF" at the end of each line)
to "^n +" (first do an "LF", then add a "+" to the front of each line)
The result is:
M1834 S_4 47 52 VDD! PCH L=239.99999143598E-9 W=3.99999998990097E-6
+AD=2.04320002757108E-12 AS=1.58200004745507E-12 PD=5.36000015927129E-6
+PS=829.999976303952E-9 NRD=+2.50000001E-01 NRS=+2.50000001E-01 M=1.0
How can I do that?
Thanks a lot,
-Walala