Sign in to follow this  
Followers 0
chinaboy

readbooks

2 posts in this topic

$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

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0