Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: ken6503
668
Posted By ken6503
A special character issue.
Hi Gurus,

I have a file contains special character.

when using:
grep 'xxxxx' filename,
it returns whole line.
when using:
grep -evt 'xxxxx' filename
it returns whole line with...
1,793
Posted By ken6503
thanks for the suggestion, I'll review the old...
thanks for the suggestion, I'll review the old post to find the solution first in the future.
1,793
Posted By ken6503
I tried below command but it gave me the record...
I tried below command but it gave me the record with one decimal as well.

awk -F"," '$2!~/\.[0-9][0-9]$/ {print $0}' test
1,793
Posted By ken6503
I have tried to search the solution from...
I have tried to search the solution from internet, but no luck at all.

my shell is ksh

my os is solaris.

thanks.
1,793
Posted By ken6503
how to find the field has more than 2 decimals
Hi Gurus,

I have below sample file, I need find the line which 2rd field has more than 2 decimals.

in sample file, I need to find xyz, 123456.789


abc, 1234.45, def
xyz, 123456.789, xxx...
1,765
Posted By ken6503
As always, thanks all of you give me such great...
As always, thanks all of you give me such great idea.

thanks again.
1,765
Posted By ken6503
How to sum the value with negative values?
Hi Gurus,

I have requirement need to sum the value, the logic is if the value is negative then time -1, I tried below two ways. one is failed, another one doesn't work.

awk -F"," '{if($8<...
2,229
Posted By ken6503
Hi RudiC, as always, thank you very much.
Hi RudiC,

as always, thank you very much.
2,229
Posted By ken6503
How to remove comma from first and last line?
Hi Gurus,

I need to remove comma from first and last line. I tried below code, but no luck. It only remove first line.
Gurus, please help.


awk -F"," '{if(NR==1||NR==$NR) print $1;...
1,167
Posted By ken6503
Thanks Scrutinizer, the code works. one more...
Thanks Scrutinizer,
the code works. one more question raised while running the scrpt.
when running code, using "$p". it works.
while read p
do
[ -n "$p" ] && para="$para,'$p'"
done < file...
1,167
Posted By ken6503
How to remove empty line.?
Hi gurus,

I have a script which works fine.

https://www.unix.com/shell-programming-and-scripting/239347-how-pass-string-into-sql-query.html


while read p
do
[ -z "$para" ] &&...
625
Posted By ken6503
How to find dupicated records?
Hi gurus,

I have a file which contains duplicated records. the records is comma delimited with more than 30 columns. I need to find the records which have exact value for each column.

thanks...
1,275
Posted By ken6503
Thanks R.Singh and neutronscott. As always....
Thanks R.Singh and neutronscott.

As always. the code you provided works perfect.

Thank you very much.

---------- Post updated at 01:16 PM ---------- Previous update was at 09:16 AM...
1,275
Posted By ken6503
How to add missing value?
Hi Gurus,

I have a txt file. some record missed 2nd colum value, I need put default value into the file.
ex: below file, first 4 records, missed one column (only 4 columns. it should be 5)

...
1,199
Posted By ken6503
Thanks for all of you give me very good...
Thanks for all of you give me very good suggestion as always.
1,199
Posted By ken6503
Can I create 3 files in one command
Hi Gurus,

I need to separate a file to 3 (based on column 1 value). I have code like below. it works.
awk -F"|" '$1=="H" {print $0}' ${filename} > ${hea_name}
awk -F"|" '$1=="D" {print $0}'...
1,726
Posted By ken6503
Hi Scrutinizer. the code works perfect. ...
Hi Scrutinizer.

the code works perfect.

As always, you gave me great help. thanks you very much.
1,726
Posted By ken6503
How to add second variable in awk nested if condition?
Hi Gurus,

I have a command to assign value based on input value.
current condition is "if pattern matches "case", then assign "HOLD" else "SUCC"right now, I need to add one more condition...
1,315
Posted By ken6503
Thanks Don, Aia and Bakunin for your excellent...
Thanks Don, Aia and Bakunin for your excellent explanation. I fully understand this now.


have a good day.
1,315
Posted By ken6503
Thanks Don for your reply. Sorry, I...
Thanks Don for your reply.
Sorry, I misunderstood you. the period is type.

when I try
par2=abc$123
export par2
I got
abc23

when trying
part=abc$xyz
export par2
I got
abc

could...
1,315
Posted By ken6503
Thanks Don for your reply. My OS is Solaris. ...
Thanks Don for your reply. My OS is Solaris.

shell is ksh.
please see attached screenshot.
1,315
Posted By ken6503
Question about enviroment variable.
Hi Gurus,

I am stuck on below issue.
in my .profile. I have two variable:

x=abc$123
t=xyz$


when running env command, I got below:

x=abc
t=xyz$


my OS is SunOS 5.10 sun4v...
1,636
Posted By ken6503
How to compare the current result with previous line result.?
Hi Gurus,
I have requirement to compare current result with previous reuslt.
The sample case is below.

1 job1 1
1 job2 2
1 job3 3
2 job_a1 1
2 job_a2 2
2 job_a3 3...
1,058
Posted By ken6503
Thanks everyone. you guys are great people.
Thanks everyone. you guys are great people.
1,058
Posted By ken6503
Script doesn't print error.
Hi Gurus,

I have below sample script. I expect it print error when running script without input parameter. but the it doesn't.

would you please help me about this issue.

thanks in advance....
Showing results 1 to 25 of 190

 

Featured Tech Videos

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