Peter.O

Australia

Age: 64

No, I don't know what orthogonal means.

1d
comment Move up every other line to end of line containing character
Have you tried the paste version? - it works, but it will blindly join line 1+2, 3+4, 5+6, 7+8, etc
1d
comment Move up every other line to end of line containing character
@user3738022: They both work for me.
1d
awarded awk
2d
comment parsing a huge file with awk and extracting a subset
@ikrabbe: head -n10000000 is much faster than sed 10000000q
2d
comment parsing a huge file with awk and extracting a subset
Yes, I was just looking into that.. I had a feeling it was too good to be true (removed now) - and adjusted time results.
2d
revised parsing a huge file with awk and extracting a subset
add and remove times
2d
comment parsing a huge file with awk and extracting a subset
This reads the entire file and takes proportionately longer as per the file size, which as the OP states, . is huge, it will take a much longer time to complete
2d
revised parsing a huge file with awk and extracting a subset
added time test for Roger Freeman
2d
revised parsing a huge file with awk and extracting a subset
grep version needed -`w` (as well)
2d
revised parsing a huge file with awk and extracting a subset
new method: cut | gref -F
2d
comment parsing a huge file with awk and extracting a subset
sed -n '/^chr10\>/{p;b};q' is a little bit faster, but not by much.
2d
revised parsing a huge file with awk and extracting a subset
added time tests
Jun
30
comment parsing a huge file with awk and extracting a subset
Just curious. How many chr10 entries are there?
Jun
30
answered parsing a huge file with awk and extracting a subset
Jun
30
comment parsing a huge file with awk and extracting a subset
Is chr10 the first line in the file? You have shown chr11, buit no chr9
Jun
30
comment What does blkid stand for?
Great! That certainly got me aware that blkid is more than just an expanded abbreviation. +1 :), and I've already given a +1 for the question. The question really caught my eye,
Jun
30
comment Stripping leading zeros using bash substring removal only
Yes, certainly. your answer addresses the question, but for my particular requirement, I want to leave just 0 if the string was 000. (by the way, it is slower than the others, but it works, and has shown an interesting use of BASH_REMATCH - they certainly weren't golfing with that name :)
Jun
30
comment Stripping leading zeros using bash substring removal only
ps. Also, This method can easily allow for a single remaining 0 - which is what I was hunting for - echo ${BASH_REMATCH[1]:-0}. – (Of course that can be done with the other answers, but would require another var assignment step).
Jun
30
comment Stripping leading zeros using bash substring removal only
I like it: +1... but I don't see the need for && -- the [[ ... ]] expression is bullet-proof; it will always result in ${BASH_REMATCH[1]} holding the correct value. Isn't a ; enough, or am I missing something, here.
Jun
29
comment What does blkid stand for?
A good question, but saying blkid means Block ID is not a good answer - perhaps it is to you, but is it enough for others? (It isn't for me). id does not stand for ID, that's just the same thing in capital letters – and what does block mean? The link you refer mentions a utility, whatis, which prints this: - command-line utility to locate/print block device attributes. From that it is reasonable to assume that id does mean identification, but I am still wondering what a block device is. Put all of this into your answer so there is no need to chase links, then +1
1 2 3 4 5