I have a file in which i have some details:
11 apple 13
15 banana 14
16 grapes 19
Now i will search for 14
and i got to know that it's in 2nd line. So here i have two options. I can do
11 apple 15
15 banana 50 //Modify that value
16 grapes 19
Or
11 apple 15
16 grapes 19
delete that line for in file.
I can do 2nd easily by creating a new file and copying the content of the original file except for that line.
But i found that unproductive. If i have 1 million such lines and deletion is frequent operation i can't do this every time.
Any idea of how to do 1st operation (replacing that particular value) and better way to do second one?