![]() String to insert: ProjectNamesowstest, into a file. ![]() This question is completely UBUNTU based and no other OS or Linux distribution. I have a script file which I need to modify with another script to insert a text at the 8th line. ![]() Let me clear everyone, I am using UBUNTU 16.04. Please note that I do not know whether the line has the word or not. Now my new content on the line becomes: This is my first testing text. Then the line appear and I move to specific characters, say your in the line and change it to my. Say for examples: command line_number 20000 /path/to/input/fileĮdit line_number 20000 /path/to/input/file Hence, I would like to know how I can extract the content from a file using its line number and then edit anything, that I want to edit and save it to the file again, without opening the file completely. But opening GB's of file again and again just to edit a single line is not worthy. grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a. I have crores of lines in the file and sometimes while importing it in some database, like mongodb, it gives trouble. sed with option -n will suppress automatic printing of pattern buffer/space. I want to know how one can get the extracted content from a file using line number. Before we start, just remember two points: sedp command lets us print specific lines based on the line number or regex provided.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |