Search Results

Search: Posts Made By: RudiC
4,328
Posted By RudiC
In fact, it's not a work around but one of the...
In fact, it's not a work around but one of the basic methods in data processing.
4,328
Posted By RudiC
A day has 24 hours; you want to assign a certain...
A day has 24 hours; you want to assign a certain value to each hour, a linear relationship that could be calculated has been rejected; so I put the desired values as defined by YOU into a 24 element...
4,328
Posted By RudiC
That little script is taking advantage of some of...
That little script is taking advantage of some of awk's idiosyncrasies / default behaviour. It creates a 24 element array B by splitting the given string using the (default if ommitted: scriptwide)...
4,328
Posted By RudiC
Try awk -F, 'BEGIN {split...
Try
awk -F, 'BEGIN {split ("3,3,3,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,2,2,0", B); B[0] = 3} {print $1, "CUT " B[$2+0]}' file



EDIT: or, even better:

awk -F, 'BEGIN {split...
4,328
Posted By RudiC
Try sed -r 's/,1[567](:[0-9]{2}){2}/ CUT 1/;...
Try
sed -r 's/,1[567](:[0-9]{2}){2}/ CUT 1/; s/,(1[89]|2[012])(:[0-9]{2}){2}/ CUT 2/; s/,0[012](:[0-9]{2}){2}/ CUT 3/' file
4,328
Posted By RudiC
Sorry, no. You say that "CUT 1" is assigned if...
Sorry, no.
You say that "CUT 1" is assigned if the stamp falls into the two hour interval 15:00h - 17:00h, "CUT 2" for 4 hours between 18:00h and 22:00h, and "CUT 3" for the 3 hrs from 0:00h till...
4,328
Posted By RudiC
Unfortunately, your relation between start hour...
Unfortunately, your relation between start hour and the CUT No. is not linear, else this might work
awk -F, '{sub (/_[^_]*_[^_]*_[^_]*$/, _, $1); split ($2, T, ":"); print $1, "CUT", int...
Showing results 1 to 7 of 7

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