Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Bash script to perl script

by hippo (Bishop)
on Jun 18, 2016 at 12:19 UTC ( [id://1166036]=note: print w/replies, xml ) Need Help??


in reply to Bash script to perl script

Since there are a lot of files so it is hard to do manually using bash for each file.

Bash answer: use a loop.

Perl has a steep learning curve, and I encourage you to follow the references in the other replies. Perl is much, much more flexible powerful and efficient than bash (or any other shell) in most circumstances and the time spent learning it will pay huge dividends. But, if you just want a quick solution you can look to use the tools with which you are already familiar.

One other top tip: never* pipe grep into awk, it's a waste of a process. Instead of your grep above you can do

awk '/R35LD1A/ && ($2**2 <0.00001&&$3**2.<0.0001){ ...

*Well, almost never. There are exceptions to every rule after all.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1166036]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found