chinaboy Posted October 4, 2008 Posted October 4, 2008 $file = FileOpen(@ScriptDir&"\news.txt", 0) $x_row=1 do $line=FileReadLine($file,$x_row) $datas = StringSplit($line, "。,.《》、") for $i=1 to $datas[0] MsgBox(0,"",$x_row&" "&$datas[$i],1) Next $x_row=$x_row+1 Until $x_row=-1 #comments-start I want to make a program to read books. It need two text:news.txt and word.txt 。 news.txt is what I want to read. word.txt contain the word i want to Split in news.txt . sample: {news.txt I want to do something.} {word.txt I want to do something } then it will give me three MsgBox. It's use for chinese word,so there maybe something different like: {news.txt 谢谢你的帮助!} {word.txt 你的 谢谢 帮助 } It means "Thank you for your help!" .So there is no spacebar in the string.(: #comments-end
Zedna Posted October 4, 2008 Posted October 4, 2008 1) StringSplit($line, ",。,.《》“”、!") should be StringSplit($line, ",。,.《》“”、!",1) 2) instead of using FileReadLine() in loop use FileRead() and split whole lines by StringSplit($text,@CRLF,1) Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now