Search Results

Search: Posts Made By: treesloth
2,112
Posted By treesloth
Ah, well, I was afraid of that. Oh, well... so...
Ah, well, I was afraid of that. Oh, well... so it goes. The current solution is adequate, and since I've managed to cut the processing time down from about 2 minutes to 11 seconds, I'll live with...
2,112
Posted By treesloth
There aren't 3 numbers in. There are, in fact,...
There aren't 3 numbers in. There are, in fact, millions and millions. The 3 lines that I posted are just a sample from a 9,000,000 line file. What I'm trying to do is use all of a system's CPU to...
2,112
Posted By treesloth
Thanks for the reply. The input I have is just a...
Thanks for the reply. The input I have is just a very simple CSV that I grabbed for testing. A sample:

00102,20150501,0001,0,CLR, ,10.00, , , ,24, ,-4.4, ,23, ,-4.9, ,21, ,-6.1, , 88, , 0, ,000,...
2,112
Posted By treesloth
awk - saving results of external script to variable.
So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file...
Forum: Programming 11-24-2014
3,232
Posted By treesloth
Python conversion to epoch time
Hi. I have timestamps that I am trying to convert to epoch time. An example:

[18/Nov/2014:05:19:56 +0000]

I am trying to convert this to an epoch timestamp but have one little glitch. I have...
1,777
Posted By treesloth
Thanks for all the replies. I'm trying out the...
Thanks for all the replies. I'm trying out the various options, and I didn't want to seem ungrateful while I do so. So, in the interest of supporting future generations of awkers, I will post...
872
Posted By treesloth
I'm sure this is doable in bash alone, but I'm...
I'm sure this is doable in bash alone, but I'm feeling dumb. So, here's a effort that also uses awk

output=`awk 'NR == 1 {for (i = 1 ; i <= NF ; i++) {if ($i == "VALUE") {colnum = i ; next}}} NR...
1,777
Posted By treesloth
Storing awk command in a variable
I'm working on a script in which gives certain details in its output depending on user-specified options. So, what I'd like to do is something like:

if [ "$2" == "detailed" ]
then
...
2,335
Posted By treesloth
So you mention "list of matching string". Are...
So you mention "list of matching string". Are there multiple strings that you're counting? For example, do you want to know how many times, in total, either "foo" or "bar" appear in an XML file?
2,335
Posted By treesloth
Some questions that might help matters along... ...
Some questions that might help matters along...

1) What mail utilities do you have available to you on the server in question?
2) Is there a single, particular string that you're trying to...
8,407
Posted By treesloth
Yoda, I always love your awk replies. They're...
Yoda, I always love your awk replies. They're very economical and clever with the concepts of awk. Thanks.
1,295
Posted By treesloth
Reapplying syntax highlighting in vim
I had a bash script (ma_report.sh) that I was editing when my VPN connection died. So, when I reconnected, I recovered my changes and reopened the file. Everything looks fine except that there is...
18,587
Posted By treesloth
Hmm... say, that is pretty nice. And it's...
Hmm... say, that is pretty nice. And it's straightforward and easy. I like the use of FNR == NR. Thank you very much.
18,587
Posted By treesloth
Better way to match a list in awk
Suppose I have a list of strings in a file called stringlist...

string1
string2
...
stringn

Suppose also that I have another file, or stdin, or whatever, and I want to use awk to see if some...
2,259
Posted By treesloth
Piping through grep/awk prevents file write
So, this is weird... I'm running this command:

iotop -o -P -k -bt -d 5

I'd like to save the output relelvant to rsyslogd to a file, so I do this:

iotop -o -P -k -bt -d 5 | grep rsyslogd >>...
4,056
Posted By treesloth
Ah, of course. That works. :-) Don't know why I...
Ah, of course. That works. :-) Don't know why I assumed that would also be broken. Many thanks.
4,056
Posted By treesloth
That is a solution, of course, but I'm using mawk...
That is a solution, of course, but I'm using mawk because of the size of the datasets we're working with. Depending on the task, we have anywhere from 3 to 7 times better performance. So, it's been...
4,056
Posted By treesloth
Mawk printf %d maxes out at 2147483647
So, I do some file processing that generates very large numbers, such as total amount GETted from a busy web cluster in a month, etc. Mawk is awesome-- fast and easy. It's awk! But, there's a...
7,994
Posted By treesloth
woot! # mawk -W version mawk 1.3.4...
woot!

# mawk -W version
mawk 1.3.4 20131226
Copyright 2013, Thomas E. Dickey
Copyright 1996, Michael D. Brennan

internal regex
compiled limits:
max NF 32767
sprintf buffer ...
3,662
Posted By treesloth
That's correct; asorti is not in my code...
That's correct; asorti is not in my code presently. When I attempted to use it, it sorted my indices alphabetically, not numerically. It was done like this:

n = asorti(littlebin, lbidx,...
7,994
Posted By treesloth
that's what I'd thought as well, but the man page...
that's what I'd thought as well, but the man page posted at the site where I got mawk indicated otherwise. I'd link it, but apparently that gets smooshed if I try.
3,662
Posted By treesloth
I attempted to use asorti, but I was unable to...
I attempted to use asorti, but I was unable to get it to sort numerically.

The code that I used is above. I simply appended " | sort -nk 1" to each "print" line. Here's the full script:
...
3,662
Posted By treesloth
awk - Why does output order change?
I have this END section in an awk script:


END {
for (j in littlebin)
{
print (j, int(log(j)/log(2)) , littlebin[j])
...
7,994
Posted By treesloth
I think what I have is the newest version of mawk...
I think what I have is the newest version of mawk available for my system:

# mawk -W version
mawk 1.3.4 20120627
How might I get it to recognize the functions I need? Or, for that matter, how...
1,374
Posted By treesloth
Thanks for the reply. I'm trying the variable...
Thanks for the reply. I'm trying the variable export to see how the completion time compares.
Showing results 1 to 25 of 173

 
All times are GMT -4. The time now is 02:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy