Search Results

Search: Posts Made By: kathy wang
2,996
Posted By kathy wang
@RavinderSingh13, sorry to reply late. I did try...
@RavinderSingh13, sorry to reply late. I did try the same code and input as you used. And I only get:
site Date time value1 value2
No any data coming out.
2,996
Posted By kathy wang
@Rudic, I really appreciate your help. Now the...
@Rudic, I really appreciate your help. Now the first code works but with another issue: I just realize the date isn't continuous for some sites. e.g.
0023 2014-01-01 21:00 90.0 20
0023 2014-01-01...
2,996
Posted By kathy wang
Thank you, Runic and Don Cragun, I had tried the...
Thank you, Runic and Don Cragun, I had tried the new code as suggested, but there is a problem. If I use the new input as below:010730023 2014-06-30 07:00 78.0 21.8081
010730023 2014-06-30 08:00...
2,996
Posted By kathy wang
RudiC, thank you. I had edited that as suggested....
RudiC, thank you. I had edited that as suggested. Here is the output I got when I use bash
awk: division by zero
input record number 1, file input
source line number 12
2,996
Posted By kathy wang
@Mr. Cragun and Ravinder, thank you for help! ...
@Mr. Cragun and Ravinder, thank you for help!

After I switch to bash, I did get some output with the limited input I gave. However, there is problem using the input below:

site Date time value1...
2,996
Posted By kathy wang
@RavinderSingh13, I got error message when I...
@RavinderSingh13, I got error message when I tried to test your script:

% awk 'NR==1{print;next} {split($3,...
2,996
Posted By kathy wang
@RavinderSingh13, thank you so much for help....
@RavinderSingh13, thank you so much for help. However I got error "previous: Event not found." I tried to search "awk keyword previous", but didn't get anything helpful. Would you please explain it...
2,996
Posted By kathy wang
Compute value from more than three consecutive rows
Hello all, I am working on a file like below:

site Date time value1 value2
0023 2014-01-01 00:00 32.0 23.7
0023 2014-01-01 01:00 38.0 29.9
0023 2014-01-01 02:00 85.0 26.6
0023 2014-01-01 03:00...
7,151
Posted By kathy wang
find the problem
(https://www.unix.com/members/28161.html) (https://www.unix.com/members/28161.html)Thank you so much, Cassj and Franklin52! I used csh (#!/bin/csh) before and always got error (Unmatched '). Now I...
7,151
Posted By kathy wang
I tried awk and gawk
Thank you for your time, Franklin52. I am using linux here. I had tried everything I can think of with both awk and gawk (we don't have nawk). But still get same error. Did I miss sth?
7,151
Posted By kathy wang
still get error
Everything looks fine to me now, but I keep getting error message as below:

awk: ./hr_2_davg.awk:3: awk -F, '
awk: ./hr_2_davg.awk:3: ^ invalid char ''' in expression

Thank you very...
7,151
Posted By kathy wang
Sorry I don't know much about awk , but I still...
Sorry I don't know much about awk , but I still got error as below:
awk: hr_2_davg.awk:3: awk -F, '
awk: hr_2_davg.awk:3: ^ invalid char ''' in expression

Thank you so much for help!
7,151
Posted By kathy wang
Sorry, I guess I didn't make my question clear. I...
Sorry, I guess I didn't make my question clear. I want to get the DAILY average output for each day in each month for each site, instead of one average output for each site. The format should look...
7,151
Posted By kathy wang
get error
Thank you so much for quick response. But should I define "i" somewhere first? I got error message as below:

awk: $4>0{a[$1]+=$4;b[$1]++}END{for i in a}{print "Average for " i " = " a[i]/b[i]}...
7,151
Posted By kathy wang
Average in awk based on time
Hi

I am looking for an awk script which can compute the average of the last column based on the date and time. The file looks:

site1,"2000-01-01 00:00:00", "2000-01-01 00:59:00",0.013...
Showing results 1 to 15 of 15

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