Hi folks,
Is there any function in Qt to find a string in a file.
Or any other solution to get a needed text instead of reading line by line.
Thanks,
-![]()
Hi folks,
Is there any function in Qt to find a string in a file.
Or any other solution to get a needed text instead of reading line by line.
Thanks,
-![]()
Qt Code:
int i = data.indexOf("Find me");To copy to clipboard, switch view to plain text mode
Thank you very much wysota.
Could you tell me how to remove a particular line from the file,
or replace that line by some other line, completely.
Thanks
-![]()
Then it's probably easiest to simply read line by line, for example append all read (and possibly modified/replaced) lines to a string(list) and then write it back to the file. You cannot remove data from the middle of a file. You have to read it all, modify, and then re-write the file.Originally Posted by npc
J-P Nurmi
npc (9th May 2006)
Bookmarks