Search Results

Search: Posts Made By: aravindj80
2,169
Posted By aravindj80
Thanks Ravinder your code worked perfect , but i...
Thanks Ravinder your code worked perfect , but i was trying with the srini code also but where to add NR>1 ?
2,169
Posted By aravindj80
Thanks it worked great , if i want to start the...
Thanks it worked great , if i want to start the replacement from the 2nd line as first line has header , how it is possible ?
2,169
Posted By aravindj80
I tried it , but all the rows are getting...
I tried it , but all the rows are getting replaced with XXXX
2,169
Posted By aravindj80
CSV file REPLACE COLUMN if it matches
I have a file
cat 1.txt
AAAA , BBBB , CCCC , DDDD
DFDF , DFDF , DFDF , FDDD
AA11 , DFDF , 0000 , UTIO
ADSD , WERT, 0000 , JKJL

If the 3rd column is not equal to "0000" , then it should...
617
Posted By aravindj80
FTP_Automation_Issue
I have a made a script to move a logs from my source server to a target server.
#! /usr/bin/ksh
year=`date +%y`
month=`date +%m`
day=`date +%d`
direc=`date +%d%m%y`
echo "backup_script_started...
2,216
Posted By aravindj80
1. Changing it to 30 3 * * * /script 2. user...
1. Changing it to 30 3 * * * /script

2. user credentials are same.

3. Script has collecting the logs and ftping the dump to another server.
2,216
Posted By aravindj80
it doesnt check any time stamp and we are not...
it doesnt check any time stamp and we are not getting any error in the cron logs also.
2,216
Posted By aravindj80
Crontab Issue
My colleague who was a sysadmin , has created a cron job script which collects logs and process them.

The script works perfectly as per the defined time set by him.

it works when we keep the...
3,204
Posted By aravindj80
Lines are repeating
I executed the code provided

awk 'BEGIN { FS="[=\t\" ]+" } NR==FNR{a[$6]=$7" "$8;next} { for(i=1;i<=NF;i++) if($i in a) {print $0" "a[$i]}}' f2 f1

output lines are getting repeated.

output...
2,379
Posted By aravindj80
Thanks Anbu
Hello Thanks Anbu,

the f1.gz output is slightly modified , the script given by is working if there is no space after comma.

gzcat f1.gz | more

< Aravind, 33, chennai, 09091980, , , , , , ,...
2,379
Posted By aravindj80
Replace a column with a value by ignoring the header lines
i have a file in the gz format , the content of the file is as follow.

gzcat f1.gz

# 1.name
# 2.location
# 3.age
# 4.dob
.
.
.
.
.
.
.
.
.
# 43.hobbies

<...
3,204
Posted By aravindj80
Got the desired output
I got the desired output and thanking you for the excellent code you have.

If you dont mind i have one more query.

Suppose in file1 if the position where we do the look up changes , how can we...
3,204
Posted By aravindj80
Output expected
Mon Mar 18 00:06:22 2013 bulk WorkOrderIntf::submit wo={ woName="3885582_2" woInfo="test1" soAction=active soName="a23ba23ba23ba41" soAction=active soName="a23ba23ba23ba41" soAction=active...
3,204
Posted By aravindj80
Apologies Mr.Panyam
nawk 'BEGIN { FS="[=\t\" ]+" } NR==FNR{a[$6]=$9" "$8;next} {if($9 in a) {print $0" "a[$9]}}' f2 f1

The output is coming as NULL...

Please help as i am struck..
3,204
Posted By aravindj80
Look up failing
cat f1
Mon Mar 18 00:06:22 2013 bulk WorkOrderIntf::submit wo={ woName="3885582_2" woInfo="test1" soAction=active soName="a23ba23ba23ba41" soAction=active ...
3,204
Posted By aravindj80
Got Error like this in Unix nawk: syntax...
Got Error like this in Unix

nawk: syntax error at source line 1
context is
>>> /^$(TZ=IST+24 <<<
nawk: bailing out at source line 1
3,204
Posted By aravindj80
Help Required
nawk '/^Sun/ && p{print p;p=""}{p=p $0}END{if(p) print p}' f1 > f3

The above helps me to concatenate all the lines that are in between from the Sun to Next Sun.

Please tell me how i can replace...
3,204
Posted By aravindj80
Update
$ cat f1
Sun Mar 17 00:01:33 2013
submit ,Name="1234"
Hello 123
how are you
Sun Mar 17 00:01:33 2013
submit , Name="1344"
Hello 345
how are you
Sun Mar 17 00:01:33 2013
submit ,...
3,204
Posted By aravindj80
Not working
I tried to use the variable it is giving error like not a valid token , can some one help.

Actually the file1.txt has multiple lines , i tried to join lines based on the date and day post which i...
3,204
Posted By aravindj80
Tried failing
nawk -v U="(TZ=IST+24 date +%a)" /U/ && p{print p;p=""}{p=p $0}END{if(p) print p}'
3,204
Posted By aravindj80
One more query
Tks for the query but one more thing , how can i give input as date in the awk command

suppose i want to awk nawk '/Sun/ && p{print p;p=""}{p=p $0}END{if(p) print p}'

I want to use TZ=IST+24...
3,204
Posted By aravindj80
Got Answer
awk -F, 'BEGIN{OFS=","}FNR==NR{a[$1$2]=$3;next}($1$2 in a && $3=$3","a[$1$2])'
3,204
Posted By aravindj80
Look up 2 files and print the concatenated output
file 1

Sun Mar 17 00:01:33 2013 submit , Name="1234"
Sun Mar 17 00:01:33 2013 submit , Name="1344"
Sun Mar 17 00:01:33 2013 submit , Name="1124"
..
..
..
..
Sun Mar 17 00:01:33 2013...
1,744
Posted By aravindj80
Thanks man it worked awesome :) and nawk also...
Thanks man it worked awesome :) and nawk also worked out
1,744
Posted By aravindj80
I tried the following cut -b14-18 input >...
I tried the following

cut -b14-18 input > input1
egrep -finput1 input > output.

In this i am getting all the lines that contain the character 1212 also.
Showing results 1 to 25 of 44

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