Search Results

Search: Posts Made By: manas_ranjan
2,686
Posted By manas_ranjan
it was with quotes, that's why was not showing it...
it was with quotes, that's why was not showing it properly.
below one is the working one:
unless you have something else in mind.
sed -i -e "s/version=\"[[:digit:].]*/version=\"$new_version/g"
2,686
Posted By manas_ranjan
sed replace is giving me sore thumbs
I want to replace only the exact match of string inside the file with another value during the run time.

So,
I have a file filename.txt
where contents are:

version="1.0.7", ...
2,595
Posted By manas_ranjan
Grep to fetch exact list
Hi

I have below lists of files

filename-1.0.0.tar.gz
filename-1.0.1.345657676.snapshots.tar.gz

so when I do grep -o 'filename-[^""]*.tar.gz' | sort | tail -1

then it consider snapshots...
466
Posted By manas_ranjan
it's not working after adding \n after printf ...
it's not working after adding \n after printf

awk -F"[ :\t]+" 'NF {A[$1,$6]++}END{for(i in A){count=A[i]; split(i, w, ",") ; for (j in w) printf("positiondetails,position=%s,client=%s count=%d",...
466
Posted By manas_ranjan
thanks, it was typo that no position2 with a "-"...
thanks, it was typo that no position2 with a "-" in field 6 ..let me try it out first and next time I will take care of it.

---------- Post updated at 07:30 AM ---------- Previous update was at...
466
Posted By manas_ranjan
Thanks RudiC. I tried this to count the columns...
Thanks RudiC. I tried this to count the columns but just couldn't relate how to combine multiple columns/rows at one.

awk -F"[ :\t]+" 'NR > 2 {A[$1]++}END{for(i in A)print i,A[i]}'

Nope I...
466
Posted By manas_ranjan
Help with ... Formating the file using awk
I have a file like below
position1 0 7802 7802 0 client1 - -
...
414
Posted By manas_ranjan
me bad....sorry.
me bad....sorry.
414
Posted By manas_ranjan
thanks but i don't think it's printing in right...
thanks but i don't think it's printing in right order.
it's printing like this

0 Leader, 13,15,11 Isr, 1, 1
1 Leader, 14,11,12 Isr, 1, 1
2 Leader, 15,12,13 ...
414
Posted By manas_ranjan
Simplified file conversion
Hi All,

I have a file like below
Topic:price PartitionCount:5 ReplicationFactor:3 Configs:
Topic: price Partition: 0 Leader: 13 Replicas: 13,15,11 Isr: 11,13
...
1,599
Posted By manas_ranjan
thanks, geniuses... I couldn't be happy more....
thanks, geniuses... I couldn't be happy more. now, I need to see if I can store this datafile in influx. let you guys know.
1,599
Posted By manas_ranjan
Split JSON to different data files
Hi Gurus,

I have below JSON file, now I want to rewrite this file into a new file.
I will appreciate if anyone can help me to provide the solution...I can't use jq.
{
"_id":...
3,548
Posted By manas_ranjan
Hi Rudi, The problem is with sum[i], it...
Hi Rudi,

The problem is with sum[i], it doesn't print the big decimal number, no matter how big I extend %f .
3,548
Posted By manas_ranjan
Hi Rudy, No it's not working can you tell...
Hi Rudy,

No it's not working
can you tell me, what I'm doing wrong here,

awk -F"," '{for (i=4;i<=NF;i++) sum[i]+=$i}{print}; END { sum[1]="Total:"; for (i=1;i<=NF;i++) {printf("%15.5f%s", ...
3,548
Posted By manas_ranjan
awk sum of all columns needs to print exact amount
Hi
I have attached txt file as input,
and i'm able to calculate sum of columns at the end but the format of sum is not coming up right.

awk -F"," '{for (i=4;i<=NF;i++) sum[i]+=$i}{print}; END {...
973
Posted By manas_ranjan
thanks Rudy 2nd option is working fine.
thanks Rudy 2nd option is working fine.
973
Posted By manas_ranjan
Hi Rudy, Thanks. But my apologies, that I...
Hi Rudy,

Thanks. But my apologies, that I have an extra column which is character, so if I apply the formula then it amend 0 to the character,

original file



...
973
Posted By manas_ranjan
Thanks Ravinder, but No it's not...
Thanks Ravinder, but No it's not working.........it's also replacing every alternate position in last columns to ZERO like SED and adding ZERO to non blank columns like first, 2nd etc...
973
Posted By manas_ranjan
Replace the character
Hi All,

I have a file with below format, columns are separated by ,
...
416
Posted By manas_ranjan
thanks from this I made little dynamic way to...
thanks
from this I made little dynamic way to serve my purpose

echo $make_target_dir_name | sed -n s"/\(.*Db-[0-9]\+\.[0-9]\+\.[0-9]\+\/\)\(.*\)/\2/p;"
416
Posted By manas_ranjan
thanks ...but I can't rely on this because my...
thanks ...but I can't rely on this
because my make_target_dir_name can have multiple subfolders and file names underneath.
e.g.
...
416
Posted By manas_ranjan
sed search could not be complete
Hi All,

I have a parameter as below

make_target_dir_name="/buildanddeploy/BUILDS/build.22/db/Db-1.17.9/SQL"

Now after writting sed I want only the output should display SQL by ripping...
1,055
Posted By manas_ranjan
thanks Rudi......it gives me more close to the...
thanks Rudi......it gives me more close to the result.
1,055
Posted By manas_ranjan
honestly I don't have any clue how to consider...
honestly I don't have any clue how to consider only one string as filed separator(=) when there are multiple same characters resides in the value.

so how can I instruct awk to only consider first...
1,055
Posted By manas_ranjan
I tried, for me the o/p looks like ...
I tried, for me the o/p looks like

<FILE_NAME>[TST_FILE</FILE_NAME>
<FILE_VALUE>[FILE_NAME</FILE_VALUE>

--> removed only extreme right ], not even replacing it

---------- Post updated at...
Showing results 1 to 25 of 299

 

Featured Tech Videos

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