thanks for pointing out the existing C var, but I couldn't figure out enough about how the arrays worked to progress further anyway
you may remember: there are 2 types of loggers in use, the 1st type creates seperate directories for each day of data, the 2nd type logs to an MS Access database. You wrote scripts for 1st type (with gawk, in windoze).
I was able to figure out enough of your original scripts to modify to use with the 2nd type (a single large txt file exported from Access). I did a query to remove data in daytime before export to minimize bird count transits but have no solution for the non-access data. So the answer is yes, it would be great if you could script elimination of daytime bird data. I need to be able to change the time of "daytime" - winter would be ~ 8am to 5pm, summer ~ 6am to 9pm; that is actual time, not modified logger time of -16 hours (PC time is minus 16 hours due to daily folders being created at midnight, which does not coincide with a bat "day")
If you feel really ambitious, it would be "nice to have" additional daily stats for "large bats" and "small bats" based on the array criteria - this would enable me to claim my design of the logger was actually correct since beams are the correct width apart to give added value data
Another "nice to have" feature would be csv daily stats output that could be easily imported to spreadsheet and graphed.
There is a bit of a problem when 2 bats transit in the same second of the day (see 1st 8 rows of sample data) this is not common but does happen. I think I was able to get around it by changing the max var from 1 to 0 to try to compensate for two transits in one second - but I probably broke something else doing this!
I was getting errors so I changed CC var to X to eliminate any chance of conflict but was still getting errors. changed these lines, was it necessary?
=========================================
and
I found the errors- missing curly brackets.
here is working code:
===============================================
ADDITIONAL INFO:
reminder this runs from zsh, you made a batch file which calls twozsh scripts, I modified these to use the output.txt file as input (same format as small sample data above)
1) bat file:
2) 1st zsh script:
3. 2nd zsh script
Last edited by cmp260; 07-22-2011 at 07:53 AM..
Reason: more information
hi i am trying to perform some calculations with awk and arrays. i have this so far:
awk 'NR==FNR{ for(i=1; i<=NF; i++) {array+=$i} tot++;next}
{for(i=1; i<=NF; i++) {avg=array/tot} {diff=(array - avg)}} {for(i=1; i<=NF; i++) {printf("%5.8f\n",diff)}}' "$count".txt "$count".ttt >... (4 Replies)
I'm at wits end with this issue and my troubleshooting leads me to believe it is a problem with the file formatting of the array referenced by my script:
awk -F, '{if (NR==FNR) {a=$4","$3","$2}\
else {print a "," $0}}' WBTSassignments1.txt RNCalarms.tmp
On the WBTSassignments1.txt file... (2 Replies)
Dear All,
I am facing problem to get right output through awk program
I have file in which “B” value is appearing multiple time and I need to capture all these values.
My script is
BEGIN { FS=" " }
{
if ( substr($1,1,5) == "START" )
{
i =... (2 Replies)
Hi all,
i have a data array as follows.
array=ertfgj2345
array=456ttygkd
.
.
.
array=errdjt3235
so number or elements in the array can varies depending on how big the data input is.
now i have a variable, and it is $1 (there are $2, $3 and so on, i am only interested in $1).
... (9 Replies)
Hi,
I rather have a very complicated awk problem here, at least to me. I have two files.
File 1:
607 687 174 0 0 chr1 3000001 3000156 -194195276 - L1_Mur2 LINE L1 -4310 1567 1413 1
607 917 214 114 45 chr1 3000237 ... (19 Replies)
I am trying to map values in the input file, where 2nd column depends on the specific value in the 1st column. When 1st column is A place 1 into 2nd column, when it is B, place 2, when C place 3, otherwise no change.
My input:
U |100|MAIN ST |CLMN1|1
A |200|GREEN LN |CLMN2|2
1 |12... (4 Replies)
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Hi, I have a problem with awk array when iam trying to use awk in solaris box as below..Iam unable to figure out the problem..
Need your help. is there any alternative to make it in arrays from variable values
nawk 'BEGIN {SUBSEP=" ";
split("101880|110045 101887|110045 101896|110045... (9 Replies)
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
I am trying to reformat the table by filling any missing rows. The final table will have consecutive IDs in the first column. My problem is the index of the associate array in the awk script.
infile:
S01 36407 53706 88540
S02 69343 87098 87316
S03 50133 59721 107923... (4 Replies)