How to check words in txt file ?

ddomi77

Новичок
Регистрация
16.08.2011
Сообщения
16
Благодарностей
0
Баллы
0
Is it possible to check caracters in file txt ?

Thanks
Dom
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Pull a block of text from the file, and then parse it with a regular expression. I think that you can do it in JS, but that's beyond me.
 

crazyflx

Новичок
Регистрация
23.08.2011
Сообщения
19
Благодарностей
8
Баллы
0
You can use javascript to check for certain characters in a txt file. Simply pull the block of text from the text file, and then use this javascript function:

var CharactertoLookFor = "%";
var StringtoLookIn = "abcdefghijklm%nopqrstuvwxyz"
StringtoLookIn.search(CharactertoLookFor);

If you open up ZP project maker, and then open the Javascript Tester and paste that into it and press play, you'll see it returns a number (that number is where the characters appears in the string).

If you remove the "%" from "StringtoLookIn" and press play, you'll see that it returns "-1" as the number, which means it couldn't find the character. To use this for what you wanted, you would replace the "abcdefgh...etc" with the execution result of the macro that pulled the block of text from the text file, and the "%" with the character you were looking to see if existed.

Then you'd use a logic operation to say:

if X = -1 do this (character not found)
if X != -1 do this (character found)
 

ddomi77

Новичок
Регистрация
16.08.2011
Сообщения
16
Благодарностей
0
Баллы
0
very good !!! Thank you ;-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)