Search Results

Search: Posts Made By: vanand420
3,380
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,652
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,836
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,992
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,237
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,106
Posted By Corona688
Useless Use of Cat...
Useless Use of Cat (http://partmaps.org/era/unix/award.html)
1,106
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,209
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,270
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,150
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,150
Posted By jayan_jay
Or pipe output to | grep '.'
Or pipe output to | grep '.'
3,897
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,188
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 06:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy