hi
i load text file from file1.text in memo then
replace string in memo1 like this
i have 50 or more strings to replaceCode:Memo1.Text := StringReplace( Memo1.Text,'number1','Text1',[rfReplaceAll]); Memo1.Text := StringReplace( Memo1.Text,'number2','Text1',[rfReplaceAll]); Memo1.Text := StringReplace( Memo1.Text,'number3','T111',[rfReplaceAll]);
After finish i have add save in oher file file2.text..
its work ok
i must replace all words in file1.text. but when i have no add some string to replace my data is "confuse"
"how to add auto checking if I dont have add string to replace then auto replace with "unknown" "
Big Thanks for help
i dont rely understand what you mean but you could use a timer and then let the timer always call the check function otherwise you could use pos to split the wanted string from the junk text xD
please explain a little more what you want to do or add a screenshot so we can help you
oki thanks for replay i have attach simple proekt
i have text file like data base and i need to cange some text with replace string.
0 ver0 nub123 code 123455 art1: mt:1 grup:2 id32454
1 cas1 vlez code 321224 art2: mt:1 grup:1 id111235
2 srt4 nub123 code 233234 art6: mt:1 grup:1 id12347
3 srt4 nub223 code 222154 art6: mt:1 grup:1 id12345
and so on
hire is question when i dont have add 222154 or another number to replace string
my data is "confuse" like this
3 srt4 nub223 code 222154 art6: mt:1 grup:2 id1234
how to add auto checking if I dont have add string to replace (example 222154) then
auto replace with "unknown"
3 srt4 nub223 code 222154 "unknown" art6: mt:1 grup:2 id1234
after replace i create another file and load to grid.
Big Thanks
First off all where does this input come from ? do you use somekind of Listview/Textboxes to get user input or what if like that you could easily test if input is given if not replace it with another string
This input coms from old data base program and i don have source from that database. Connected with new try this file.I must resolve this problem from this text file.
3 srt4 nub223 code 222154 art6: mt:1 grup:2 id1234
when if not found string to replace to add "unknown"
3 srt4 nub223 code 222154 "unknown" art6: mt:1 grup:2 id1234
thats il all.
Thanks for replay.
My hunch is that you're approaching this wrong. Instead of treating it as a single string, treat it as fields. It appears to be space/tab delimited, so break each line into an array of values, and process those.
"I ask you if you have a solution to the problem" send my small example it will more easy to"Continue from there"
Big Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks