Search Results

Search: Posts Made By: vegasluxor
978
Posted By vegasluxor
Expected out put is as below: awk...
Expected out put is as below:

awk '/abc123/{x=NR+1}(NR<=x){print}' sftp_log_INDB_20150317.log

mput abc123? 227 Entering Passive Mode (10,87,148,57,136,63)
150 Opening data connection for...
978
Posted By vegasluxor
awk - how to pass varible
I want to pass variable to below awk statement
awk '/abc123/{x=NR+1}(NR<=x){print}' sftp_log_20150317.log

I tried -v like below, but its not working. Please help!!!
awk -v var1="abc123"...
3,908
Posted By vegasluxor
Ftp - file transfer and check successful delivery
In shell script, I want to transfer files continuously and make sure transfer is successful.
Please advise... how to make sure ftp transfer is successful?
Also is there any option such as sftp -b...
4,767
Posted By vegasluxor
Thanks !!! :) second awk and grep worked!!! ...
Thanks !!! :)
second awk and grep worked!!!

---------- Post updated at 04:07 AM ---------- Previous update was at 04:01 AM ----------

@anbu
sed solution worked well!!! Thanks a lot :)
4,767
Posted By vegasluxor
Tried below options of awk.. but it works only...
Tried below options of awk.. but it works only for zero spaces.

awk -F',' '! $1 ~ /./'
awk -F',' '$1=="" {print $0}'
4,767
Posted By vegasluxor
awk - CSV file - field with single or multiple spaces
Hi,

In a csv file, I want to select records where first column has zero or multiple spaces.

Eg: abc.csv
,123,a
,22,b
,11,c
a,11,d

So output should be:

,123,a
,22,b
,11,c...
4,724
Posted By vegasluxor
Yes! perl solution worked! thanks :) Please let...
Yes! perl solution worked! thanks :) Please let me know, if i want to change column number of second file, where the change will be in in perl code? Sorry for the dummy question

[test@test]$ cat...
4,724
Posted By vegasluxor
Here is the screenshot. Is there any other awk...
Here is the screenshot. Is there any other awk solution i can try? Please advise and thanks for your support!

[test@test]$ cat f1
971507520787
[test@test]$ cat f2
1,2,0971507520787
2,2,333...
4,724
Posted By vegasluxor
awk 'FNR==1{++i}{print ( ( i == 1 ) ? $1 : $3+0 )...
awk 'FNR==1{++i}{print ( ( i == 1 ) ? $1 : $3+0 ) }' f1 FS=',' f2
971507520787
9.71508e+11
333

cat f1
971507520787

cat f2
1,2,0971507520787
2,2,333

I am using awk on AIX. Its not...
4,724
Posted By vegasluxor
I am getting syntax error. awk...
I am getting syntax error.

awk 'FNR==1{++i}{print i==1 ? $1 : $3+0}' f1 FS=',' f2
Syntax Error The source line is 1.
The error context is
FNR==1{++i}{print >>> i== <<<
...
4,724
Posted By vegasluxor
Ok.. f1 971507520787 f2 ...
Ok..

f1
971507520787

f2
1,2,0971507520787
2,2,333

Code
awk 'FNR==NR{a[$1];next}!($3+0 in a)' f1 FS=',' f2

Output
1,2,0971507520787
2,2,333


awk '{ sub("\r$", "") }...
4,724
Posted By vegasluxor
Still no luck :( Don't know why its not working...
Still no luck :(
Don't know why its not working on AIX
4,724
Posted By vegasluxor
Thanks for you inputs !! I am not sure why its...
Thanks for you inputs !!
I am not sure why its not working for below numbers

my data:
f1:
971507520787

f2:
1,2,0971507520787
2,2,333
-------
awk 'FNR==NR{a[$1];next}!($3+0 in a)' f1...
4,724
Posted By vegasluxor
awk pattern matching
I have two files, want to compare file1 data with file2 second column and print line which are not matching. Need help in matching the pattern, file2 second column number can be leading 0 or 00 or...
1,819
Posted By vegasluxor
I directly used egrep in the folder, instead of...
I directly used egrep in the folder, instead of using find & cat... but still performance issue is there. Any other command will give better performance... ? Please advise.

---------- Post updated...
1,819
Posted By vegasluxor
Performance improvement in grep
Below script is used to search numeric data from around 400 files in a folder. I have 300 such folders. Need help in performance improvement in the script.

Below Script searches 20 such folders (...
4,203
Posted By vegasluxor
Thanks a lot. Could you please explain logic as...
Thanks a lot. Could you please explain logic as well?
print is not used here then how come it is printing whole line? What if i want to print specific columns only?
4,203
Posted By vegasluxor
awk - if else condition
Need help in awk command.

Need to check 4th column of a file, if it is CAR then awk should print as is and if 4th column is not present, awk should print BIKE

Input File content :...
9,561
Posted By vegasluxor
Thanks a lot ! It worked !!! :)
Thanks a lot ! It worked !!! :)
1,694
Posted By vegasluxor
@Robin Thanks a lot !!! Yes! this will...
@Robin
Thanks a lot !!! Yes! this will defiantly help me to start.

---------- Post updated at 07:22 AM ---------- Previous update was at 07:21 AM ----------
@ctsgnb...
9,561
Posted By vegasluxor
Thanks! But how do I find 3 digits before 10...
Thanks!
But how do I find 3 digits before 10 digits from right ? Number could be greater or less than 10... if greater it might have leading multiple zeros.. So need to compare from the right side...
9,561
Posted By vegasluxor
awk - how to compare part of the string?
Need help for awk..
file will have comma separated numbers, I need check digits before 10 numbers eg ( 001)1234567890
Basically want to check country code of a mobile number.

eg:
abc,def,data,...
3,477
Posted By vegasluxor
Thanks but i want to use only egrep for this.
Thanks but i want to use only egrep for this.
3,477
Posted By vegasluxor
Egrep how to make sure string is after 5 comma
Hello,

Need help...

using egrep how do I make sure string is after 5th comma

example:
a,b,c,d,e,f,g,h,i

Suppose i want to search letter f but want to make sure it is after 5th comma....
1,694
Posted By vegasluxor
Extracting recording using egrep
Hello,

Need help using egrep

file format:
test.gz
Date, time, , number 1, number 2, counter...
20130618,912154, ,009912345678,911111111111,10000, , ,abc
20130618,982148,...
Showing results 1 to 25 of 47

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