On Wed, 2006-11-29 at 09:36 -0900, Ken Irving wrote:
On Wed, Nov 29, 2006 at 02:32:37PM +, michael wrote:
I guess a complete rephrase is best.
What I want is how many processors does each WAITING job in lsf queues
require?. From 'bhist' I get outputs such as below (see whitespace
Having all that whitespace in the 'wrong' spot breaks the idea of
splitting words based on their being surrounded by whitespace. So get
rid of __all__ whitespace. Then use other logic find what you want.
E.g. if you want the 'word' following the 'word' processor, find the
first occurance of
On Mon, 2006-11-06 at 01:10 +1100, John O'Hagan wrote:
Or the whole thing could even be done with (I think!):
#tr -d '\n' IN | tr ' ' '\n' | grep -B1 Processor | grep -v 'Processor\|--'
i.e., remove the newlines, replace all the spaces with newlines, then grep
for
the line before
I guess a complete rephrase is best.
What I want is how many processors does each WAITING job in lsf queues
require?. From 'bhist' I get outputs such as below (see whitespace
anywhere in num Processors) and cannot determine a sure way of always
parsing it...
Thanks, Michael
EXAMPLES:
~/bin$
On Wed, Nov 29, 2006 at 02:32:37PM +, michael wrote:
I guess a complete rephrase is best.
What I want is how many processors does each WAITING job in lsf queues
require?. From 'bhist' I get outputs such as below (see whitespace
anywhere in num Processors) and cannot determine a sure way
On Wednesday 08 November 2006 03:08, Andrew Sackville-West wrote:
On Wed, Nov 08, 2006 at 02:51:20AM +1100, John O'Hagan wrote:
I tried this, and found that replacing the newlines with spaces stops the
grep from working because it puts spaces in the middle of any occurrences
of Processor,
On Thu, Nov 09, 2006 at 12:52:57AM +1100, John O'Hagan wrote:
tr -d '-\n' IN | tr '\n' ' ' | tr -s ' ' '\n' | grep -B1 'Processor'
| grep -v 'Processor\|--'
[...]
Aha! You're right, my lines fail on the edge cases, and also when the target
word is hyphenated.
Your ingenious
On Thursday 09 November 2006 03:40, Andrew Sackville-West wrote:
On Thu, Nov 09, 2006 at 12:52:57AM +1100, John O'Hagan wrote:
[...]
while read i ; do
if [[ $(echo $i | grep \\-\$ ) ]]; then
i=$( echo $i | sed s/-\$//)
echo $i
John O'Hagan wrote:
On Thursday 09 November 2006 03:40, Andrew Sackville-West wrote:
SO I wonder what happened to the OP? Is he just watching waiting for
the right solution, or is he long gone?
[...]
OP? What OP? :)
The one who hopefully got an A for his answer.
--
Steve C.
On Mon, Nov 06, 2006 at 10:26:53PM -0600, Russell L. Harris wrote:
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:34:30PM -0800, Steve Lamb wrote:
Depends on what you define as elegant.
when I was learning to program (mid 80's), we considered anything
outside of brute force to
On Tuesday 07 November 2006 02:55, Andrew Sackville-West wrote:
On Tue, Nov 07, 2006 at 01:00:34AM +1100, John O'Hagan wrote:
[...]
You're right; but the OP, Michael, gave the above scenario as his
problem. If your situation were the case, though, I guess we could use tr
-d '-' to get rid
On Tue, Nov 07, 2006 at 08:56:55AM -0500, Douglas Tutty wrote:
On Mon, Nov 06, 2006 at 10:26:53PM -0600, Russell L. Harris wrote:
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:34:30PM -0800, Steve Lamb wrote:
Depends on what you define as elegant.
when I was learning to
On Wed, Nov 08, 2006 at 02:51:20AM +1100, John O'Hagan wrote:
I tried this, and found that replacing the newlines with spaces stops the
grep
from working because it puts spaces in the middle of any occurrences
of Processor, but I see what you mean about the edge case. I think this
On Tue, Nov 07, 2006 at 08:08:12AM -0800, Andrew Sackville-West wrote:
On Wed, Nov 08, 2006 at 02:51:20AM +1100, John O'Hagan wrote:
...
Have we done this to death yet? :)
there must be more. I haven't seen any perl junkies provide us with
some permutation of
On Tue, Nov 07, 2006 at 09:36:27AM -0900, Ken Irving wrote:
On Tue, Nov 07, 2006 at 08:08:12AM -0800, Andrew Sackville-West wrote:
On Wed, Nov 08, 2006 at 02:51:20AM +1100, John O'Hagan wrote:
...
Have we done this to death yet? :)
there must be more. I haven't seen any perl
On Monday 06 November 2006 18:38, David Jardine wrote:
On Mon, Nov 06, 2006 at 11:27:58AM +1100, John O'Hagan wrote:
[...]
E.g., if IN contains:
junk info 18 Pro
But what if that line were:
junk info 18 Pro-
which seems more likely?
[...]
You're right; but the OP, Michael, gave
On Tue, Nov 07, 2006 at 01:00:34AM +1100, John O'Hagan wrote:
On Monday 06 November 2006 18:38, David Jardine wrote:
On Mon, Nov 06, 2006 at 11:27:58AM +1100, John O'Hagan wrote:
[...]
E.g., if IN contains:
junk info 18 Pro
But what if that line were:
junk info 18 Pro-
On Tue, Nov 07, 2006 at 01:00:34AM +1100, John O'Hagan wrote:
On Monday 06 November 2006 18:38, David Jardine wrote:
On Mon, Nov 06, 2006 at 11:27:58AM +1100, John O'Hagan wrote:
[...]
E.g., if IN contains:
junk info 18 Pro
But what if that line were:
junk info 18 Pro-
On Mon, Nov 06, 2006 at 07:55:02AM -0800, Andrew Sackville-West wrote:
On Tue, Nov 07, 2006 at 01:00:34AM +1100, John O'Hagan wrote:
On Monday 06 November 2006 18:38, David Jardine wrote:
On Mon, Nov 06, 2006 at 11:27:58AM +1100, John O'Hagan wrote:
[...]
E.g., if IN contains:
On Sun, Nov 05, 2006 at 05:21:23PM +1100, John O'Hagan wrote:
On Sunday 05 November 2006 16:42, John O'Hagan wrote:
On Sunday 05 November 2006 09:03, Ken Irving wrote:
On Fri, Nov 03, 2006 at 09:56:12PM -0500, Douglas Tutty wrote:
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
Douglas Tutty wrote:
After thinking about it, yes it can all go in one line. Its more
elegant and doesn't use up memory space but its harder to read to
understand what its doing.
Depends on what you define as elegant. I dropped Perl several years ago
in preference to Python because I
With all the permutations, especially around possible hyphenations, it
starts to be easier to look at whatever is creating this hypothetical
silly hyphenated file. (note its the file thats silly, not the
hypothetical suggestion of hyphens).
Sometimes its too easy to keep trying to solve the
Douglas Tutty wrote:
Sometimes its too easy to keep trying to solve the wrong problem.
True, but it sure does answer the question How do you keep a programmer
geek busy? :)
--
Steve C. Lamb | But who decides what they dream?
PGP Key: 8B6E99C5 | And dream I
On Mon, Nov 06, 2006 at 01:34:30PM -0800, Steve Lamb wrote:
Depends on what you define as elegant.
when I was learning to program (mid 80's), we considered anything
outside of brute force to be elegant. Also, anything non-obvious was
also considered elegant. Anything that used a
On Mon, Nov 06, 2006 at 04:58:18PM -0800, Steve Lamb wrote:
Douglas Tutty wrote:
Sometimes its too easy to keep trying to solve the wrong problem.
True, but it sure does answer the question How do you keep a programmer
geek busy? :)
If you want to keep busy, write this in assembler
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:34:30PM -0800, Steve Lamb wrote:
Depends on what you define as elegant.
when I was learning to program (mid 80's), we considered anything
outside of brute force to be elegant. Also, anything non-obvious was
also considered
On Sunday 05 November 2006 17:21, John O'Hagan wrote:
On Sunday 05 November 2006 16:42, John O'Hagan wrote:
On Sunday 05 November 2006 09:03, Ken Irving wrote:
On Fri, Nov 03, 2006 at 09:56:12PM -0500, Douglas Tutty wrote:
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
On Mon, Nov 06, 2006 at 01:10:08AM +1100, John O'Hagan wrote:
Or the whole thing could even be done with (I think!):
#tr -d '\n' IN | tr ' ' '\n' | grep -B1 Processor | grep -v 'Processor\|--'
nice.
A
signature.asc
Description: Digital signature
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:10:08AM +1100, John O'Hagan wrote:
Or the whole thing could even be done with (I think!):
#tr -d '\n' IN | tr ' ' '\n' | grep -B1 Processor | grep -v 'Processor\|--'
nice.
Except for one problem. Look at the OP's post and you'll
On Sun, Nov 05, 2006 at 10:08:12AM -0800, Steve Lamb wrote:
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:10:08AM +1100, John O'Hagan wrote:
Or the whole thing could even be done with (I think!):
#tr -d '\n' IN | tr ' ' '\n' | grep -B1 Processor | grep -v
'Processor\|--'
Andrew Sackville-West wrote:
tr -d '\n'
deletes the new lines
Ahhh, ok. Was still going off of the previous Python examples which
didn't delete newlines, only replaced them with spaces. Mea Culpa.
--
Steve C. Lamb | But who decides what they dream?
PGP Key:
On Sun, Nov 05, 2006 at 10:29:42AM -0800, Steve Lamb wrote:
Andrew Sackville-West wrote:
tr -d '\n'
deletes the new lines
Ahhh, ok. Was still going off of the previous Python examples which
didn't delete newlines, only replaced them with spaces. Mea Culpa.
I have to say that
On Monday 06 November 2006 05:29, Steve Lamb wrote:
Andrew Sackville-West wrote:
tr -d '\n'
deletes the new lines
Ahhh, ok. Was still going off of the previous Python examples which
didn't delete newlines, only replaced them with spaces. Mea Culpa.
Oops again! What I meant to do
On Monday 06 November 2006 05:14, Andrew Sackville-West wrote:
On Sun, Nov 05, 2006 at 10:08:12AM -0800, Steve Lamb wrote:
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:10:08AM +1100, John O'Hagan wrote:
Or the whole thing could even be done with (I think!):
#tr -d '\n'
On Monday 06 November 2006 02:53, Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:10:08AM +1100, John O'Hagan wrote:
Or the whole thing could even be done with (I think!):
#tr -d '\n' IN | tr ' ' '\n' | grep -B1 Processor | grep -v
'Processor\|--'
nice.
I just can't let this
On Mon, Nov 06, 2006 at 11:27:58AM +1100, John O'Hagan wrote:
On Monday 06 November 2006 05:14, Andrew Sackville-West wrote:
On Sun, Nov 05, 2006 at 10:08:12AM -0800, Steve Lamb wrote:
Andrew Sackville-West wrote:
On Mon, Nov 06, 2006 at 01:10:08AM +1100, John O'Hagan wrote:
Or the
On Fri, 2006-11-03 at 13:32 -0800, Aleksei Dzhulai wrote:
The simplest case:
awk '{for (i=1;i=NF;i++) {if ($i~/Processor/) print $(i-1)} }' file
This doesn't work at all for me. Given the file:
BOF
junk info 18 Pro
cessor
EOF
It produces no output.
I think this should do what you want.
On Fri, Nov 03, 2006 at 09:56:12PM -0500, Douglas Tutty wrote:
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
I've been trying to do this with 'awk' but am hitting probs (not used
awk for ages!) so all offers welcome!
Given a multiple line file, IN, that contains the word
On Sat, Nov 04, 2006 at 01:03:14PM -0900, Ken Irving wrote:
On Fri, Nov 03, 2006 at 09:56:12PM -0500, Douglas Tutty wrote:
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
I've been trying to do this with 'awk' but am hitting probs (not used
awk for ages!) so all offers welcome!
On Sunday 05 November 2006 09:03, Ken Irving wrote:
On Fri, Nov 03, 2006 at 09:56:12PM -0500, Douglas Tutty wrote:
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
[...]
eg for
junk info 18 Pro
cessor
I wish to get the field '18'
[...]
Since it appears that
On Sunday 05 November 2006 16:42, John O'Hagan wrote:
On Sunday 05 November 2006 09:03, Ken Irving wrote:
On Fri, Nov 03, 2006 at 09:56:12PM -0500, Douglas Tutty wrote:
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
[...]
eg for
junk info 18 Pro
cessor
I
I've been trying to do this with 'awk' but am hitting probs (not used
awk for ages!) so all offers welcome!
Given a multiple line file, IN, that contains the word Processor
(possibly split over 2 lines) I wish to output the field immediately
preceeding Processor.
eg for
junk info 18 Pro
cessor
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
I've been trying to do this with 'awk' but am hitting probs (not used
awk for ages!) so all offers welcome!
Given a multiple line file, IN, that contains the word Processor
(possibly split over 2 lines) I wish to output the field
The simplest case:
awk '{for (i=1;i=NF;i++) {if ($i~/Processor/) print $(i-1)} }' file
michael писал(а):
I've been trying to do this with 'awk' but am hitting probs (not used
awk for ages!) so all offers welcome!
Given a multiple line file, IN, that contains the word Processor
(possibly
On Fri, 2006-11-03 at 13:32 -0800, Aleksei Dzhulai wrote:
The simplest case:
awk '{for (i=1;i=NF;i++) {if ($i~/Processor/) print $(i-1)} }' file
I don't think that will pick up the case where the required output is on
the line before Processor, but thanks, M
--
To UNSUBSCRIBE, email to
michael wrote:
On Fri, 2006-11-03 at 13:32 -0800, Aleksei Dzhulai wrote:
The simplest case:
awk '{for (i=1;i=NF;i++) {if ($i~/Processor/) print $(i-1)} }' file
I don't think that will pick up the case where the required output is on
the line before Processor, but thanks, M
I didn't catch
On Fri, Nov 03, 2006 at 08:27:42PM +, michael wrote:
I've been trying to do this with 'awk' but am hitting probs (not used
awk for ages!) so all offers welcome!
Given a multiple line file, IN, that contains the word Processor
(possibly split over 2 lines) I wish to output the field
47 matches
Mail list logo