Hi Dear Friends,
In this post We would like to share infinity knowladge My Good experience and Best solution For .
Try this it will help you and for more information click here: Laravel Examples.
We hope it can help you...
In this post We would like to share infinity knowladge My Good experience and Best solution For .
Laravel Examples
Hi Guys,
If you want to add a line in file at specific line number through script. Below examples will help you to do it.
For example you have a file named file1.txt, file content are as below.
Now you required to add text “tecadmin 3” at line number 3, use below command
Above command will create a new file file1.txt.tmp with expected output
Replace origin file with tmp file
Details of the `sed` command:
sed: is the command itself.
2: line number where new line will be inserted.
i: parameter, which told sed to insert line.
tecadmin 2: text to be added.
file1.txt: is the file in which new line need to add.
file1.txt.tmp: New file with updated content.
2: line number where new line will be inserted.
i: parameter, which told sed to insert line.
tecadmin 2: text to be added.
file1.txt: is the file in which new line need to add.
file1.txt.tmp: New file with updated content.
Read :
I hope you like this Post, Please feel free to comment below, your Any Idea, suggestion and problems if you face - I am here to Resolve your Any problems.We hope it can help you...
No comments :
Post a Comment