Regular Expression to append a string in text file
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Here are some sentences from Text File.
hi where are you going.
hi how are you doing.
how are you.
hi where are you at this moment.
i want to replace '.' with '</s>'
so i am writing the following expression
- fid = fopen('Text_File.txt','w');
- f=fread(fid,'*char')';
- f = regexprep(f,'\.','</s>')
it is working perfectly BUT, i want to append a starting symbol at the beginning of sentences also that is '<s>', for that that i am using following one.
- f = regexprep(f,'^[]','<s>');
but it is not working what wrong i am doing.
PLZ answer thanks in advance.
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!