Search Results

Search: Posts Made By: vanand420
3,321
Posted By Peasant
See if this helps : awk 'NR <= 2 { print }...
See if this helps :

awk 'NR <= 2 { print } NR > 2 { print $1" : "$3-$4 FS $4-$5 }' input
1,602
Posted By vidyadhar85
try.. awk -F";" '/^alarm/{split($5,A,"...
try..


awk -F";" '/^alarm/{split($5,A," ");
getline;
split($5,B," ");
split(A[2],C,":");
split(B[2],D,":");
E=(D[1]*60*60+D[2]*60+D[3])-(C[1]*60*60+C[2]*60+C[3]);
{if(E>59){print "Alarm...
1,810
Posted By Lem
Uhm... strange. And what did happen? ...
Uhm... strange. And what did happen?

However, try also this alternative:


mapfile -t line <myfile; for i in ${!line[@]}; do echo -n "${line[$i]};"; done; echo
1,948
Posted By tukuyomi
Is your file already tab-delimited? Here a...
Is your file already tab-delimited?
Here a straight bit of code:
#!/usr/bin/awk -f

BEGIN{
OFS="| ";print "NAME| DATE| TIME| HI| FI| BV| LR| TS| HR| ES| MR| KS| RR"
}
/\+\+\+/{
s=$3 OFS $4...
4,172
Posted By Ygor
Try...awk '/\/\*------/{if(b)print...
Try...awk '/\/\*------/{if(b)print b;b=$0;next}NF{b=b "^" $0}END{print b}' file1 > file2
1,083
Posted By Corona688
Useless Use of Cat...
Useless Use of Cat (http://partmaps.org/era/unix/award.html)
1,083
Posted By frappa
cat input.txt | awk ' NR % 3 == 1 { printf $1 " "...
cat input.txt | awk ' NR % 3 == 1 { printf $1 " " }; NR % 3 == 2 { printf $0 } ; NR % 3 == 0 { print $1 , $3 } '

look for 'modulo' operator on awk manual.
see ya
fra
1,198
Posted By Scrutinizer
In the second awk, you are assigning the outcome...
In the second awk, you are assigning the outcome of /Jan/ (1 if true, 0 if false) to field 1.., in the first one, you are comparing 0 or 1 to the value of field 1..
What you are probably looking for...
1,254
Posted By Corona688
This should print the the position of everything...
This should print the the position of everything as well as its contents.

awk -v RS="" '{ for (N=1; N<=NF; N++) print N, $N ; printf("\n"); }' filename
2,105
Posted By Scrutinizer
Optimal method: | awk NF -- Then...
Optimal method:
| awk NF

--


Then probably your input file differs from the posted sample you posted. Can you show us in what way?
2,105
Posted By jayan_jay
Or pipe output to | grep '.'
Or pipe output to | grep '.'
3,883
Posted By vbe
The errors come from the syntax usage which...
The errors come from the syntax usage which wants the command followed by options if any then [name... ]
so looking at your command line you get:

gzcat (the command) [ no options]...
1,166
Posted By Corona688
You can compare 24-hour HH:MM:SS times with < > =...
You can compare 24-hour HH:MM:SS times with < > = since they sort alphabetically. So you just match the day and time, and use that to turn on and off a variable. That variable decides whether it...
Showing results 1 to 13 of 13

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