Search Results

Search: Posts Made By: supernono06
5,917
Posted By Corona688
MS Windows has three kinds of directory paths...
MS Windows has three kinds of directory paths which partly overlap and partly don't and almost no programs implement all of them.

BASH would be no help here, as in UNIX, there's only one kind of...
2,616
Posted By RavinderSingh13
Hello supernono06, Again assuming that your...
Hello supernono06,

Again assuming that your Input_file(s) are same as shown ones, if yes then following may help you here.


awk 'FNR==NR{a[FNR]=$1;val++;next} {count=count==val?0:count}...
2,616
Posted By RavinderSingh13
Hello supernono06, Please do wrap your...
Hello supernono06,

Please do wrap your samples in CODE TAGS(see how my command looks similarly see co de button while editing your post and wrap your examples in it). Could you please try...
2,616
Posted By RavinderSingh13
Hello supernono06, For this shown...
Hello supernono06,

For this shown Input_file1, could you please try following and let me know if this helps you.

awk 'FNR==NR{a[FNR]=$0;val++;next} {count==val?"":count}...
2,616
Posted By RavinderSingh13
Hello supernono06, So I am assuming 2 things...
Hello supernono06,

So I am assuming 2 things here.

1st: You want to do replacement wherever string keyword is found on lines of Input_file1.

2nd: I am assuming that in case number of lines...
2,616
Posted By RavinderSingh13
Hello supernono06, Could you please try...
Hello supernono06,

Could you please try following and let me know if this helps.


awk -v n=3 'FNR==NR{a[FNR]=$0;next} {sub("string1",a[n])} 1' file2 file1


OR in case you directly want...
1,421
Posted By RudiC
Then adapt the regex to sth. like...
Then adapt the regex to sth. like 7[4-9]|8[0-9]|9[0-3].
1,421
Posted By Scrutinizer
Try this adaptation of Jim's suggestion: sed -r...
Try this adaptation of Jim's suggestion:
sed -r '/^USE solution ([2-9]|[12][0-9]);/ { s,-4.000,-2.000, }' file1.txt > file2.txt
2,228
Posted By RudiC
Yes, this is a feature of awk: if the variable...
Yes, this is a feature of awk: if the variable has an integer value, it uses %d, not the defined default format... Try
awk '{$10+=1e-9; $11+=1e-9; $12+=1e-9}1' CONVFMT="%.2e" file
2,228
Posted By RudiC
Try also awk '{$10+=0; $11+=0; $12+=0}1'...
Try also
awk '{$10+=0; $11+=0; $12+=0}1' CONVFMT="%.2e" file


And, you can't modify the file in place (even the editors that claim doing so work on temporary file overwriting the original with...
2,228
Posted By vgersh99
awk -v f='10 11 12' 'BEGIN{split(f,a)} {for(i=1;...
awk -v f='10 11 12' 'BEGIN{split(f,a)} {for(i=1; i in a;i++) $a[i]=sprintf("%.2e", $a[i])}1' myFile
Showing results 1 to 11 of 11

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