![]() |
|
|
#287 | |
|
Jun 2003
7·167 Posts |
Quote:
Code:
ORS="\r\n" I could have merged the two tests. Instead of Code:
$5 in bita {
if (bita[$5] > $8) bita[$5] = $8
if (bitb[$5] < $11) bitb[$5] = $11
next
}
$5 ~ /[0-9]+/ {
bita[$5] = $8
bitb[$5] = $11
}
Code:
$5 ~ /[0-9]+/ {
if (! ($5 in bita) || bita[$5] > $8) bita[$5] = $8
if (! ($5 in bitb) || bitb[$5] < $11) bitb[$5] = $11
}
|
|
|
|
|
|
|
#288 | |
|
Romulan Interpreter
Jun 2011
Thailand
32·29·37 Posts |
Quote:
(or what you believe that you told them to do).
Last fiddled with by LaurV on 2011-11-17 at 05:51 |
|
|
|
|
|
|
#289 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
Indeed, it is for Winblows. I was wondering about the regex, but what it output worked just fine, seeing as the only numbers to be parsed are the ones we need.
|
|
|
|
|
|
#290 |
|
Dec 2010
Monticello
179510 Posts |
Perhaps it is time I learned awk...but what I would say of perl is:1) It is a GENERAL tool. I'd argue that unless the user has a lot of work to do that the specific tool is really good at, the general tool is better. This is not the case here; this is a one-off that will soon be forgotten when the task is over. 2) Perl is designed as a conscious attempt to minimise the amount of programming effort for one-off problems. 3) If sed can do it, perl has a "sed" mode. Now, let's fight!!! ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Anyone know what I should look at on the net besides "man awk"? |
|
|
|
|
|
#291 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3·29·83 Posts |
http://www.grymoire.com/Unix/Awk.html is what I used to crap together my not-a-program.
|
|
|
|
|
|
#292 | ||||
|
Jun 2003
7×167 Posts |
Quote:
If you only have the general tool, it might be worth acquiring the specific tool if you did have a lot of work that it's really good at. If you only have the specific tool, it might be worth acquiring the general tool if you had even a little work the specific tool was not good at. Quote:
Quote:
Quote:
|
||||
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A quick question | Pegos | Information & Answers | 6 | 2016-08-11 14:39 |
| Quick TF Question | Dubslow | GPU Computing | 2 | 2011-10-27 04:49 |
| Quick msieve question | alkirah | Msieve | 2 | 2009-12-30 14:00 |
| Quick question about P90 CPU metric | stars10250 | PrimeNet | 9 | 2008-08-31 23:58 |
| Quick p-1 question | Unregistered | Software | 8 | 2006-10-13 23:35 |