Search Results

Search: Posts Made By: baghera
20,661
Posted By baghera
But if there is more numbers on that line for...
But if there is more numbers on that line for example:

how_old_r_u:45782<br>APPLY:[30000,t3,t4]:Plummet

It seems when I run the command

grep -oE "[[:digit:]]{1,}" input.txt

I also get the...
2,531
Posted By baghera
Problem solved: cat *folder*/file.html |...
Problem solved:

cat *folder*/file.html | grep "hola"

*folder* is a name that all the folders have incommon and then I use grep the get the line containing to numbers.


Cheers
2,531
Posted By baghera
But this seems to be for perl? I need something...
But this seems to be for perl? I need something for bash. Also the number of directories will vary so I need the script to search through every folder in speciefied folder.
2,531
Posted By baghera
Traverse catalogs
Here is my problem (it seems I've a lot of problems nowadays).

I have several folders:

runner.20070830.12.45.12
runner.20070830.12.45.15
runner.20070830.12.45.17
runner.20070830.12.45.20...
20,661
Posted By baghera
grep or awk problem, unable to extract numbers
Hi, I've trouble getting some numbers from a html-file. The thing is that I have several html-logs that contains lines like this:

nerdnerd, how_old_r_u:45782<br>APPLY: <hour_second> Verification...
9,161
Posted By baghera
I wonder why I have to use nawk when sitting in...
I wonder why I have to use nawk when sitting in Solaris 9, since it seems to have both awk and nawk?

>>which awk
/usr/bin/awk

>>which nawk
/usr/bin/nawk


Because at home I used awk for...
9,161
Posted By baghera
Works like a charm, thank you. But if the input...
Works like a charm, thank you. But if the input should come from another command, how would that look like?

output | awk -v n=2 -f bag.awk

Would the above work? Because the input isn't always...
9,161
Posted By baghera
Sorry maybe I'm not made my self clear. So I will...
Sorry maybe I'm not made my self clear. So I will explain.

I've a list in a file that looks like this:

1
2
1
2

What I want to do is to tell my script how many columns I would like. So if...
9,161
Posted By baghera
Huh? I tried your script but I only get 1.5 ...
Huh? I tried your script but I only get 1.5

when I have list:

1
2
1
2

The output should be:
1
2

Or on the same row 1 2

As I described above. But there should also be the...
9,161
Posted By baghera
Thanks Jean-Pierre, now I don't get any errors....
Thanks Jean-Pierre, now I don't get any errors. But the output is wierd.

If I have the list:

1
2
1
2

This would produce:
1 2
1 2

So the output should be 1 and 2 (1+1/2 and 2+2/2 ),...
9,161
Posted By baghera
Ok I did as you said: data=`cat $2 |...
Ok I did as you said:


data=`cat $2 | xargs -n $1`

#echo $data

columns=$1
i=1
echo $columns

while [ "$columns" -gt 0 ]
do
awk_cmd=`awk -v i=$1 '{sum+=$i} END {print sum/NR}'`
...
9,161
Posted By baghera
While-loop with awk
Hi, I have recently posted in another thread started by me :D. But in an effort to make my script more beautiful I've been thinking abbout while loops.

I run my script with the command:

sh...
14,443
Posted By baghera
Thanks, I found several ways to make the outprint...
Thanks, I found several ways to make the outprint more beautiful. I just want to say to everybody that helped me: THANK YOU.
14,443
Posted By baghera
No it is still the same problem, but I'm much...
No it is still the same problem, but I'm much closer to a solution.

So I'm sorry if it confusing some of you. While looking for a way to solve my problem I've been looking at sed/awk/perl and...
14,443
Posted By baghera
Is there any nice command with awk to count the...
Is there any nice command with awk to count the elements in an column? Not an entire program but some nice short way to count the elements like so:

1
2
3
4

Then the "counter" should say 4...
14,443
Posted By baghera
So I changed to INPUT=$INPUT like in the...
So I changed to INPUT=$INPUT like in the original, but I still isn't able to execute the program, the command I'm running is:

awk -v INPUT=2 -f test.awk

and changed the filename to test.txt...
14,443
Posted By baghera
Alright I ran what you suggested and it worked....
Alright I ran what you suggested and it worked. How can you make it so that you can provide a variable for how many columns you would like, as you showed me in in the previous program? And then how...
14,443
Posted By baghera
I'm running this command: awk -v INPUT=2 -f...
I'm running this command:

awk -v INPUT=2 -f test.awk test

isn't this correct. Also I just copied your code into test.awk and test is a file with numbers, like so:

1
2
3
4
5
6

The...
14,443
Posted By baghera
I really appreciate the help. I like the...
I really appreciate the help.

I like the xargs thing. Is it then possible to add each element in a column and divide it by the numbers of elements in the column.

I've used this command:
...
14,443
Posted By baghera
List to columns and awk help
Hi I'm new to this forum and I'm a beginner when it comes to shell programming and awk programming. But I have the following problem:

I've a list like this:

1
2
3
4
5
6
7
8

Either...
Showing results 1 to 20 of 20

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