Search Results

Search: Posts Made By: mukeshguliao
3,491
Posted By mukeshguliao
Log File Manipulation
I have a log file which keeps on updating. What I need to do is write a different script, which could moniter the log file continously, and email some stakeholders if some error has occured..

log...
1,688
Posted By mukeshguliao
hmm...well thanks.. but this dont seem to solve...
hmm...well thanks.. but this dont seem to solve the purpose

its like

abc.txt

emp
dept
table2


and there is script already there..

export ORAUSER=`grep ORAUSER...
1,688
Posted By mukeshguliao
read database tablename from another file
i hava a file which contains database like

emp
dept
loc


now i want to create a script that read this file line by line and create a seperate query that ll be run in database like..
...
2,503
Posted By mukeshguliao
thanks man..
thanks man..
2,503
Posted By mukeshguliao
yeah this works for me.. just wanted to ask one...
yeah this works for me..
just wanted to ask one more thing.. how did u guys figured out this DOS newline format thing.
2,503
Posted By mukeshguliao
here is the input file attached.. but i...
here is the input file attached..

but i guess the problem is with nawk/awk

m using ksh shell, cant change it coz the job is a part of another huge script written for ksh shell.
2,503
Posted By mukeshguliao
there is one more thing.. when i run with...
there is one more thing..
when i run with "awk" i get an error


awk -F"|" '$26~/./ && !a[$24FS$26] {a[$24FS$26]++;print $24FS$26}' OTCeg.dat
awk: syntax error near line 1
awk: bailing out...
2,503
Posted By mukeshguliao
@pravin there is no space though.. its just...
@pravin
there is no space though.. its just delimited with |. New line after that..

this doesnt return anything at all :(
awk -F"|" '$24 ~/[[:alnum:]]/ && $26~/[[:alnum:]]/ && !a[$24FS$26]...
2,503
Posted By mukeshguliao
yes this works for the sample i provided... ...
yes this works for the sample i provided...
but cant figure out it is failing to skip the last col's blank record in my original file..

here is the chunk of file ...
2,503
Posted By mukeshguliao
awk help
i have a file like


col1, col2, col3, col4, col5, col6,col7,col8
a,b,c,d,e,1,t,11
b,e,,w,,1,,
c,r,c,d,e,1,t,11
d,f,c,g,w,1,e,22
e,f,c,d,e,1,w,33
f,e,f,r,t,1,t,22
g,h,t,d,e,2,s,22...
2,216
Posted By mukeshguliao
extract specific string and rename file
Hi all,

I am working on a small prog..
i have a file.txt which contains random data...
K LINES V4 ADD CODE `COMPANY` ADD CODE `DISTRIBUTOR` SEQ NAME^K LINES V5 SEQ NAME^K LINES V6 ADD...
3,285
Posted By mukeshguliao
hi i tried these two options in csh and bash ...
hi i tried these two options in csh and bash


cat UnixEg.dat | awk -F',' '{key=$1$2$3;if(key in a) next; else a[$1$2$3]=$0; print a[$1$2$3]}'

awk -F',' '{key=$1$2$3;if(key in a) next; else...
72,009
Posted By mukeshguliao
getting an error while using this. awk...
getting an error while using this.


awk -F',' '!x[$1$2$3]++' UnixEg.dat
x[$1$2$3]++': Event not found


---------- Post updated at 11:22 PM ---------- Previous update was at 09:44 PM...
2,369
Posted By mukeshguliao
awk -F, '!a[$1,$2,$3]++' UnixEg.dat i...
awk -F, '!a[$1,$2,$3]++' UnixEg.dat


i tried above, but got an error
a[$1,$2,$3]++': Event not found






guess could be beacause of ! . escaped by \

awk -F, '\!a[$1,$2,$3]++'...
2,369
Posted By mukeshguliao
sed sorting command explanation
sed '$!N; /^\(.*\)\n\1$/!P; D'

i found this file which removes duplicates irrespective for sorted or unsorted file. keep first occurance and remove the further occurances.

can any1 explain...
3,285
Posted By mukeshguliao
it seems fine to me, but its still anit working ...
it seems fine to me, but its still anit working

trying this (csh shell)
awk -F',' '{key=$1$2$3;if(key in a) next; else a[$1$2$3]=$0; print a[$1$2$3]}' UnixEg.dat


getting
awk: syntax...
3,285
Posted By mukeshguliao
thanks for the quick response. i am trying...
thanks for the quick response.

i am trying this in /usr/bin/csh shell. it gives an error
magu1@gmmagappu1% awk -F',' '{key=$1$2$3;if(key in a) next; else a[$1$2$3]=$0; print a[$1$2$3]}...
3,285
Posted By mukeshguliao
Filter/remove duplicate .dat file with certain criteria
I am a beginner in Unix. Though have been asked to write a script to filter(remove duplicates) data from a .dat file. File is very huge containig billions of records.

contents of file looks like...
Showing results 1 to 18 of 18

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