Search Results

Search: Posts Made By: Madiouma Ndiaye
2,229
Posted By Scrutinizer
Try: awk...
Try:
awk 'NR==3{sub($1,sprintf("%.9f",$1*0.96))}1' file1.txt > file1_new.txt
2,229
Posted By RudiC
Try awk 'NR==3 {$1*=0.96} 1' CONVFMT="%.9f" OFS="...
Try awk 'NR==3 {$1*=0.96} 1' CONVFMT="%.9f" OFS=" " file
2.259314750 xxxxxx
1.962774350 xxxxxx
2.800144598 xxxxxx
1.355026900 xxxxxx
1.677389740 xxxxxx...
1,155
Posted By mjf
Try sed with “i” command to insert a line before...
Try sed with “i” command to insert a line before match for your request to add only one line.

$ cat file.txt
1
2
3
4
5
$ sed "4 i\Inserted new line" file.txt
1
2
3
Inserted new line
4...
1,155
Posted By spacebar
Insert line after every 7th line: sed -n...
Insert line after every 7th line:
sed -n 'p;n;p;n;p;n;p;n;p;n;p;n;p;i\inserted line' file_1 >file_2
1,155
Posted By RavinderSingh13
Hello, Here is an awk example for same, it...
Hello,

Here is an awk example for same, it may help.
For example an input file is:


1 5
2 4
3 3


Code is:

awk 'NR==2 {print "checking the insertion."} 1' file_name


Output...
1,917
Posted By Scrutinizer
Try: awk '!((NR-1)%m),!((NR-p)%m)' m=291 p=288...
Try:
awk '!((NR-1)%m),!((NR-p)%m)' m=291 p=288 file
1,917
Posted By blackrageous
I think you can use the head and tail commands to...
I think you can use the head and tail commands to achieve what you want.
18,802
Posted By Don Cragun
If the line numbers, filenames, and string to be...
If the line numbers, filenames, and string to be replaced are all the same, the directories are literally named "dir<digit>", and the replacement string is the same <digit> as found in the directory...
Showing results 1 to 8 of 8

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