Search Results

Search: Posts Made By: palanisvr
3,249
Posted By palanisvr
for i in `cat file` do fld1=`echo $i | tr -d...
for i in `cat file`
do
fld1=`echo $i | tr -d '[0-9]'`
fld2=`echo $i | tr -d '[a-z]' |tr -d '[A-Z]'`
echo $fld1 " " $fld2 >> tmp.txt
sort -n -k2 tmp.txt |awk -F ' ' '{print $1$2}'
rm -f tmp.txt...
10,588
Posted By palanisvr
Try this ...
suppose that file content lies in a.txt

fld1=`awk -F'=' '{print $1}' a.txt|tr '\n' ','|sed s/".$"//`
fld2=`awk -F'=' '{print $2}' a.txt|tr '\n' ','|sed s/".$"//`
echo $fld1
echo $fld2
2,677
Posted By palanisvr
Try this
cat file.txt |tr ',' '\n' | tr -d ' '
3,923
Posted By palanisvr
Try this ...
#capture the script request in a unix host variable from database
v_script_request==`sqlplus -s user/password@dbname <<!
set feedback off heading off pagesize 0
select REQUEST_ACTION from...
1,660
Posted By palanisvr
Try with this..
Code :

$cat test.fnc
v1=$1
function findRecord() {
output=`grep $v1 recordDatabase`
echo $output
}
#call function
findRecord

execute the function

$sh...
9,937
Posted By palanisvr
find /ontw/log -type f -mtime +31 |grep -v ...
find /ontw/log -type f -mtime +31 |grep -v /ontw/log/lost+found | xargs rm
3,830
Posted By palanisvr
try this
cat testfile.txt |sed '/^$/d' | sed s/$/\\n/
5,704
Posted By palanisvr
I think you havent copied the code completly ,...
I think you havent copied the code completly , you have missed copying "done" .
3,205
Posted By palanisvr
Try the new updated one.
hope this should fix your issue , as there are lot of white space between the field values I have hard coded the columns to replace with null so change accordingly as per your request if you want to...
3,205
Posted By palanisvr
I could find in the script that you are refering...
I could find in the script that you are refering to incorrect file in the grep condition , I have changed it accordingly, try with this.

#!/bin/ksh
sed 's/^[ \t]*//' cdr.txt > cdr_1.txt
sed...
3,205
Posted By palanisvr
Try with the updated one . #!/bin/ksh ...
Try with the updated one .


#!/bin/ksh
for i in `grep -n "CDR" cdr.txt |awk -F ':' '{print $1}'`
do
i=`expr $i + 2`
idx=`expr $i + 5`
echo `sed -n "$i","$idx"p cdr.txt|awk ...
3,205
Posted By palanisvr
This should help you
#!/bin/ksh
for i in `grep -n "CDR" cdr.txt |awk -F ':' '{print $1}'`
do
i=`expr $i + 2`
idx=`expr $i + 5`
echo `sed -n "$i","$idx"p cdr.txt|awk '{print $2}'|tr "\n" " " |awk -F ' '...
3,205
Posted By palanisvr
Try this , I have developed the code w.r.t data provided by you .
#!/bin/ksh

for i in `grep -n "-" tempfile.dat |awk -F ':' '{print $1}'`
do
echo $i
idx=`expr $i + 3`
echo idx : $idx
echo `sed -n "$i","$idx"p tempfile.dat|awk '{print $2}'|tr...
Showing results 1 to 13 of 13

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