Page 1 of 1

Retrieve all words/phrases

PostPosted: Sat Feb 25, 2012 8:56 am
by Alex
Hi,

I have a Neobook pub with about 300 files in the functions folder, I don't want to open each files and to search all texts words/phrases and to put them in a TEXT.txt file that contains all the software sentences (the sentences are to going to be translated). I think the total is 3000 phrases. Is there a way to make a script that detect words/phrases between " and " and to automatically put them in TEXT.txt and that replace the phrase by a variable like [TEXT1]; [TEXT2]...

For example:
Code: Select all
setvar "[var1]" "Searching..."
setvar "[var1]" "[TEXT1]"

CustomWindow "Information" "" "" "Rectangle1" "DialogBox"
CustomWindow "[TEXT2]" "" "" "Rectangle1" "DialogBox"


so in my pub starting I will put
Code: Select all
FileRead "[PubDir]TEXT.txt" "1" "[TEXT1]"


Thanks


Alex

PostPosted: Sat Feb 25, 2012 11:51 am
by dec
Hi Alex,

I figure here a task for Regular Expressions and of course lot of work... but the question can be: how many times do you need to achieve this? For example, suposing you forget to prepare the appropiate "variables for translation" in one publication, even if a lot of translations is need, maybe compensate to do it manually in comparison with triying to do an script like you can imagine. So supose how many time I supose for this script... ;)

PostPosted: Sat Feb 25, 2012 12:08 pm
by Alex
Hi Dec,

Yes thanks for the answer.

I don't know, but I was juts thinking about this and if it is possible to do it.

Thanks


Alex

Re: Retrieve all words/phrases

PostPosted: Wed Feb 29, 2012 2:49 pm
by dpayer
Alex wrote:Hi,

I have a Neobook pub with about 300 files in the functions folder, I don't want to open each files and to search all texts words/phrases and to put them in a TEXT.txt file that contains all the software sentences (the sentences are to going to be translated). I think the total is 3000 phrases. Is there a way to make a script that detect words/phrases between " and " and to automatically put them in TEXT.txt and that replace the phrase by a variable like [TEXT1]; [TEXT2]...

Alex


Alex, Microsoft has a free utility called qgrep.exe found in the 2003 server resource kit (free download).

Here is a quick reference someone made for it: http://ss64.com/nt/qgrep.html

You can have it look for phrases in a big file and it will tell you the line number in that file that contains the phrase (you can port the results to a text file). So you don't need to open each file in NB and search, you could use a batch program to search multiple files and then import the results.

I have used it to search massive log files for specific entries and it was very helpful.

In any case, 300 files is a lot of files to look through.


David Payer