Need urgent help with PERL scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need urgent help with PERL scripting
# 1  
Old 02-16-2012
Java Need urgent help with PERL scripting

From the attached file I to need pick all rows that have AVG2 column value larger than 0.050, and write those values in to a separate file. Help me on how I pick the approp value & output them onto a file.

Very Thanks in advance. Smilie
# 2  
Old 02-16-2012
Please provide tab delimited output for the next time. Check this one out.

Your input file was edited this way


Quote:
| gdshfghfhdfhdfhdfhdfh | wwwwwwwwww | 1 | 0.024 | 0.021 | 0.030 | 0.024 | A ^ -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhds | wwwwwwwwww | 2 | 0.037 | 0.021 | 0.063 | 0.061 | A ^ -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhd | wwwwwwwwww | 2 | 0.032 | 0.020 | 0.041 | 0.092 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhd | wwwwwwwwww | 1 | 0.015 | 0.014 | 0.021 | 0.107 | A v -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfhdfhd | wwwwwwwwwwww | 1 | 0.021 | 0.009 | 0.020 | 0.129 | A ^ -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.011 | 0.010 | 0.020 | 0.140 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.012 | 0.015 | 0.081 | 0.152 | A v -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 2 | 0.074 | 0.048 | 0.185 | 0.226 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.111 | 0.067 | 0.089 | 0.337 | A v -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.087 | 0.049 | 0.114 | 0.424 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.118 | 0.069 | 0.113 | 0.542 | A v -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.117 | 0.062 | 0.109 | 0.659 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.112 | 0.064 | 0.109 | 0.770 | A v -> X ^ |
Your output

Quote:
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 2 | 0.074 | 0.048 | 0.185 | 0.226 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.111 | 0.067 | 0.089 | 0.337 | A v -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.087 | 0.049 | 0.114 | 0.424 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.118 | 0.069 | 0.113 | 0.542 | A v -> X ^ |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.117 | 0.062 | 0.109 | 0.659 | A ^ -> X v |
| gdshfghfhdfhdfhdfhdfh gdshfghfhdfhdfh | wwwwwwwwww | 1 | 0.112 | 0.064 | 0.109 | 0.770 | A v -> X ^ |
Code I have used
Quote:
awk -F"|" '{if($5>0.05) print $0}' inputfile
Thanks to all these forum members, for making me a simple awk programmer. It promotes learning a lot.
# 3  
Old 02-16-2012
Smith, your awk does a wonderful job ! Thanks!! but can you help me on how to implement this by means of simple PERL commands?
# 4  
Old 02-16-2012
Tony,

I am just a very brand new coder from a pure biological field. I visit this forum very often to find solutions. And, since your task was very easy I gave a try to it on my basic knowledge with awk.

I have no idea about PERL. Sorry for not being able to help you. SmilieSmilieSmilie

Thanks
# 5  
Old 02-16-2012
Thats totally okay Smith. You have no reason to be sorry. BTW u are one good awk 'er !! Keep it up.
# 6  
Old 02-16-2012
Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.

If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.

Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.


Thank you.

The UNIX and Linux Forums
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

2. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

3. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

4. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

5. Shell Programming and Scripting

it's urgent ! round number in perl scripting

my $number = 12.345673412 I need 3 digits after decimal or after dot(.) i mean , i need only 12.345 I used int(), ceil(), floor() but it gives me only 12 I need it. (10 Replies)
Discussion started by: pritish.sas
10 Replies

6. Shell Programming and Scripting

Urgent Korn Shell scripting Help Pleaaaase...

Hello All, Can someone help me to set a user's password from the script using korn shell. The password change is a one time password after user account creation. I tried providing the input file as the value for password field but password change requires tty so my password from an input file... (3 Replies)
Discussion started by: solaix14
3 Replies

7. Shell Programming and Scripting

Umbrella Scripting(very Urgent)

Hi All, Can anybody help me to write the umbrella script for the following? I have three steps to do. STEP 1: CONVERT XML files to PS files STEP 2: CONVERT ALL PS FILES TO PDF FILES STEP 3: FTPING ALL PDF FILES TO THE SERVER. I have the codes for the above three steps. Now I... (6 Replies)
Discussion started by: sunitachoudhury
6 Replies

8. Shell Programming and Scripting

Please help me out:-Its Urgent-C Shell Scripting

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There... (0 Replies)
Discussion started by: Prince89
0 Replies

9. Shell Programming and Scripting

help needed in shell scripting......urgent

Dear friends, please help me to solve following problem. I'm running a frontend application from which i'll be invoking the shell script with arguments as given below -driver -w -p "ABC XYZ" -S -ds con -dn "abc xyz" i am getting $1=-driver $2=-w $3=-p $4="ABC $5=XYZ" $6=-S $7=-ds... (3 Replies)
Discussion started by: swamymns
3 Replies
Login or Register to Ask a Question