Search Results

Search: Posts Made By: siya@
Forum: Programming 05-07-2013
1,497
Posted By Yoda
You are doing it wrong! To update string:...
You are doing it wrong!

To update string: sample to data, use below SQL:
update clusters set name = replace(name, 'sample', 'data');
Before committing select & verify the output:
select name,...
3,106
Posted By Don Cragun
siya, Your description of what you are trying...
siya,
Your description of what you are trying to do is not at all clear. Looking at the "required result" in message #4 in this thread, I'm guessing that you want to replace PH01 immediately...
3,106
Posted By Don Cragun
What makes you think you need to split the 1st...
What makes you think you need to split the 1st column before modifying it?

Why not just modify the 1st 10 characters on the line instead of splitting, modifying the 1st 10 characters on the line,...
3,106
Posted By RudiC
One way would besed 's:.:& :10' fileto split, and...
One way would besed 's:.:& :10' fileto split, and sed 's: ::' file to merge again.
1,412
Posted By glev2005
If your example is correct, it seems that you...
If your example is correct, it seems that you basically want to print out everything except the uppercase lines, which could be done easily with
grep -v '^[A-Z]' filename.txt
1,412
Posted By rdrtx1
try: grep -E "^gi_|^series_|^pattern_"...
try:
grep -E "^gi_|^series_|^pattern_" input.txt
2,911
Posted By Yoda
How about: sort -k1.8n infile Here is the...
How about:
sort -k1.8n infile
Here is the o/p:
# cat infile
>string2991 234445
>string224 470561
>string121 675386
>string4098 177229
>string8049 255838
>string8 672382
>string1115 578415
...
2,911
Posted By Don Cragun
Hi rdrtx1, At least on OS X this doesn't work. ...
Hi rdrtx1,
At least on OS X this doesn't work. Since a is created by a call to sub(), it is being treated as a string instead of as a number in the comparisons that set the minimum and maximum...
2,911
Posted By rdrtx1
also, another awk example without the need to...
also, another awk example without the need to pipe to sort and sed:
awk '{a=$1;sub("^[^0-9]*","",a);b[a]=$0; m?(0):(m=a); if (a<m) m=a; if (a>x) x=a;}
END{for (i=m; i<=x; i++) {if (b[i])print...
2,911
Posted By rdrtx1
try: awk...
try:
awk '{a=$0;sub("^[^0-9]*","",a);b[a$1]=a":::"$0} END{for (i in b) print b[i]}' infile | sort -n | sed 's/.*::://'

or
sed 's/^\([^0-9]*\)\([0-9]*\)/\2 :::\1\2/' infile | sort -n | sed...
Showing results 1 to 10 of 10

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