delete a line from file.
-
Hi All, I'm using CStdioFile to read a file line by line, I want to delete line 5,6,9 from the file. Plz give me hint or soln.. thax :)
-
Hi All, I'm using CStdioFile to read a file line by line, I want to delete line 5,6,9 from the file. Plz give me hint or soln.. thax :)
You can either write the lines to another file without writing the lines you want to delete. Then delete the original and rename the new file with the original name. Or you could store all the required lines in memory and overwrite the original file.
«_Superman_» I love work. It gives me something to do between weekends.
-
You can either write the lines to another file without writing the lines you want to delete. Then delete the original and rename the new file with the original name. Or you could store all the required lines in memory and overwrite the original file.
«_Superman_» I love work. It gives me something to do between weekends.
-
me sathish first take the contents of the file using FILE* like c funtions gradually turn to next line ,meanwhile to store a static value if the pointer goes to downwards if reached 456 write " " ie empty text there ...
ya
sathish / satheesh, You need to reply to the original poster, not the helper. The original poster will be more interested in your assistance. Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
-
me sathish first take the contents of the file using FILE* like c funtions gradually turn to next line ,meanwhile to store a static value if the pointer goes to downwards if reached 456 write " " ie empty text there ...
ya
me carlo go straight forward until you reach the first crossroad with traffic lights, then turn left and straight forward to the next crossroad with traffic lights where you will take the left turn and then make a turn on first available street on your right. Go straight forward down the street and at the end, on your right you'll see the hotel. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
me carlo go straight forward until you reach the first crossroad with traffic lights, then turn left and straight forward to the next crossroad with traffic lights where you will take the left turn and then make a turn on first available street on your right. Go straight forward down the street and at the end, on your right you'll see the hotel. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Makes perfect sense to me, although I question why you opted to turn down that one street.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons