Search Results

Search: Posts Made By: ravzter
2,875
Posted By agama
You don't need to cat the file into awk, awk can...
You don't need to cat the file into awk, awk can read the file on it's own.

This will read the file and create three output files: one for below or equal to 40, one for between 40 and 50 and one...
2,875
Posted By ctsgnb
nawk '$7<95{next} $4>=50{print $0...
nawk '$7<95{next}
$4>=50{print $0 >"above.txt";next}
$4>40{print $0 >"between.txt";next}
$4<=40{print $0 >"below.txt";next}
' /log/per_111217.txt
2,960
Posted By Shell_Life
The following code will give you the data with...
The following code will give you the data with three sorted columns:
paste -d' ' - - - < In_File | sort -nk3 Out_file
1,628
Posted By mirni
I don't have a complete solution, but it still...
I don't have a complete solution, but it still may be of help to you; a more general way to tackle complex problems:

Break it up into simpler tasks:
1. extract just the lines starting with c: or...
Forum: Solaris 02-27-2011
3,560
Posted By DukeNuke2
you should relace the boot disks on both systems...
you should relace the boot disks on both systems (c0t0d0) and the disk c2t9d0 on the primary system.
what kind of disks (size, interface) do you use for this setup on the standby system?
d520 -m...
Forum: Solaris 02-26-2011
3,560
Posted By Perderabo
I don't have any experience on a system this big,...
I don't have any experience on a system this big, so my instincts may be wrong. But I would be suspicious if mirrors this big scyned in only 6 hours. Are you sure that the live mirrors are ok? If...
4,163
Posted By bartus11
Simply remove the "break" command :)
Simply remove the "break" command :)
4,163
Posted By bartus11
LIST=`cat /tmp/ips`
LIST=`cat /tmp/ips`
4,163
Posted By alister
Hello, ravzter and bartus11: Unless i...
Hello, ravzter and bartus11:

Unless i misread, I don't think bartus11's script will do what you want. Except for every 4th ip address, it checks for the ip address in the log after only giving...
4,163
Posted By bartus11
Something like this might work:#!/bin/ksh i=1; ...
Something like this might work:#!/bin/ksh
i=1;
LIST="1.2.3.4 1.2.3.5 1.2.3.6 1.2.3.7 1.2.3.8 1.2.3.9 1.2.3.10"
for ip in $LIST; do
deviceReboot -reboot $ip
if [ $((i%4)) == "0" ]; then sleep...
2,181
Posted By vgersh99
try this: print substr($1,6,7) RS "\t"...
try this:

print substr($1,6,7) RS "\t" substr($1,1,5) "\t" $3 >> fn
2,181
Posted By Franklin52
There are too many files open, try this: awk...
There are too many files open, try this:
awk -F\| '{
fn=tolower(substr($1,1,4)) ".csv"
print substr($1,6,7) RS "\t" substr($1,1,5) "\t" $3 > fn
close(fn)
}' file

Use nawk or...
2,181
Posted By Franklin52
Try this: awk -F\| '{print substr($1,6,7) RS...
Try this:
awk -F\| '{print substr($1,6,7) RS "\t" substr($1,1,5) "\t" $3 > tolower(substr($1,1,4))".csv"}' file
3,574
Posted By rdcwayx
$ awk --version|head -1 GNU Awk 3.1.8 $...
$ awk --version|head -1
GNU Awk 3.1.8

$ awk -F "[ ,]" '
{for (i=3;i<=NF;i++) {split($1,a,"-"); date=a[1]"/"a[2];d[date];s[date OFS i]+=$i}}
END{ n=asorti(d,t)
for (j=1;j<=n;j++) printf t[j]...
3,574
Posted By durden_tyler
Given this data file - $ $ $ cat...
Given this data file -


$
$
$ cat input.txt
10-06-2006 17:09:28,1880,1862,1865,1866,1879,1881,1879,1879
10-06-2006 17:19:28,1885,1883,1884,1884,1648,1648,1648,1648
10-06-2006...
3,574
Posted By durden_tyler
Here's a short Perl script for the job - ...
Here's a short Perl script for the job -


$
$ # show the contents of the data file "f6"
$
$ cat f6
10-06-2006 17:09:28,1880,1862,1865,1866,1879,1881,1879,1879
10-06-2006...
5,757
Posted By rdcwayx
awk ' /0x12/{...
awk ' /0x12/{ split($4,a,":");min=int(a[2]/10)*10;date=substr($3,5);b[date FS a[1] ":" sprintf("%02d",min) FS $(NF-10)]++}
END{for (i in b) print i,b[i] }' infile
5,757
Posted By rdcwayx
awk ' /0x12/{ split($1,a,":"); ...
awk ' /0x12/{
split($1,a,":");
min=int(a[2]/10)*10;
b[a[1] ":" sprintf("%02d",min) FS $9]++
}
END{for (i in b) print b[i],i }
' maryhada.log.2011-01-28

12 00:00 1432
3...
2,640
Posted By pseudocoder
Try without -p switch, like following: echo...
Try without -p switch, like following:
echo "You must type the date in this format ---> MM-DD-YYYY" && read vdate

If this won't work, please post your current script, maybe there's a typo or...
2,640
Posted By pseudocoder
s/.*-[0-9]\{4\} //' It works as following:...
s/.*-[0-9]\{4\} //'
It works as following: deletes everything before the last minus sign followed by 4 digits.

Try to improve your already existing sed part like this:
sed 's/:[0-9][0-9] /...
2,640
Posted By frans
sed
read -p "You must type the date in this format ---> MM-DD-YYY" vdate
grep $vdate log.csv | sed -e "s/^$vdate //" -e 's/\:[0-9][0-9] / /' | tee /tmp/bk_$vdate.csv
2,640
Posted By pseudocoder
Yeah, I also wondered about that... ...
Yeah, I also wondered about that...

@ravzter
However, no matter if it's comma separated or whitespace separated, there are no fields $12-$18 ;)

If it's comma separated, try to replace your...
2,640
Posted By Franklin52
Try: #!/bin/bash echo "You must type the date...
Try:
#!/bin/bash
echo "You must type the date in this format ---> MM-DD-YYYY"
read vdate

awk -v dat=$vdate '$0 ~ dat{$1="";sub("...$","",$2);sub("^ ","")}1' file
2,640
Posted By clx
you are using field separator as comma (-F,) but...
you are using field separator as comma (-F,) but your file doesn't seems to be csv file!!

don't you want the date field?

try:

awk -v dd="$vdate" '/dd/ {$2=substr($2,1,5);for (i=2;i<=NF;i++)...
Showing results 1 to 24 of 24

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