I want to know how one can get the extracted content from a file using line number. I have crores of lines in the file and sometimes while importing it in some database, like mongodb, it gives trouble. So I need to edit it. But opening GB's of file again and again just to edit a single line is not worthy.
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. Say for examples:
command line_number 20000 /path/to/input/file
This your first testing text. edit line_number 20000 /path/to/input/file
Then the line appear and I move to specific characters, say
your in the line and change it to
my. Now my new content on the line becomes:
This is my first testing text.
Please note that I do not know whether the line has the word or not. So, first I need to check the line. Display the line using line number. and then edit it.
Is there a way to achieve it.
Let me clear everyone, I am using UBUNTU 16.04. This question is completely UBUNTU based and no other OS or Linux distribution. Please not this.