Search Results

Search: Posts Made By: kalee
9,160
Posted By kalee
Thanks for your reply. My input csv file...
Thanks for your reply.

My input csv file format is as below that contains 1000s of rows. I just need a 6 unique cases of rows.

1434455221 - 15.12 25.13 85221 65221...
9,160
Posted By kalee
-F option and - V in a single awk statment
Please let me know if I can use -F option and - V in a single awk statment. I want to import some comma separated shell variables using -F option and defining some static variables inside awk using...
8,641
Posted By kalee
I am giving my simplified code. ...
I am giving my simplified code.

statfile=test.csv
case1=0
case2=0


cat $statfile | while read line


do
COLUMN1=$(echo $line | awk -F, '{print $1'})
COLUMN2=$(echo $line | awk -F,...
8,641
Posted By kalee
I got it. Thanks. BTW. How to increment the...
I got it. Thanks.

BTW. How to increment the shell variable inside awk.
8,641
Posted By kalee
Thank you for your reply. Please note that I need...
Thank you for your reply. Please note that I need to use a shell variable that contains the value of "-" to use it inside awk script. I can not use $4 directly. I need to use a shell variable, say...
8,641
Posted By kalee
The sample error at the if ( '$COLUMN2' =!...
The sample error at the

if ( '$COLUMN2' =! /-/ ){

else if ( '$COLUMN2' ~ "-" ){


awk: cmd. line:3: if ( =! /-/ ){
awk: cmd. line:3: ^...
8,641
Posted By kalee
Please let me know a sample code to use a shell...
Please let me know a sample code to use a shell variable that contains the value of "-" to use it inside awk script.
8,641
Posted By kalee
awk: cmd. line:32: if ( - ~...
awk: cmd. line:32: if ( - ~ /-/ ){
awk: cmd. line:32: ^ syntax error

I get this error at the line -- if ( '$COLUMN2' == /-/ ){
8,641
Posted By kalee
I was able to access the shell variable inside in...
I was able to access the shell variable inside in awk. My actual question is how to compare with the symbol like minus "-" or "$" etc


~ "/-/"

or

~ \\-

But none works.
8,641
Posted By kalee
compare minus symbol "-" with a column
Need to compare minus symbol "-" with a column that contains minus on few rows.

the sample script awk I have written is

if ( '$COLUMN2' ~ "\-" ) {}

COLUMN2 is a shell variable. I just...
Showing results 1 to 10 of 10

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