Source language: Translate to:

Please help me

General questions about NeoBook

Moderator: Neosoft Support

Please help me

Postby franco21 » Mon Apr 27, 2015 2:30 pm

as I can remove from a list a string of the final

example

mariomartin@gmail.com.test
lopezlosana@lamarilda.com.ar.test

I need to take the end of each line around the .text list

I do not realize how to use the remove that chain
franco21
 
Posts: 122
Joined: Tue Jan 14, 2014 3:46 pm

Re: Please help me

Postby Gaev » Mon Apr 27, 2015 3:51 pm

franco21:

Something is getting lost in translation ... so why don't you provide an example of the "input text" ... and the desired "output text"
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Re: Please help me

Postby Gaev » Tue Apr 28, 2015 4:07 am

franco21:

Thank you for the example.

Am I correct in thinking that you want to end up with unique values ? ... i.e. if there are two/more identical entries in "input", you want only one "output" entry ?

Also, can you describe where the "input" is stored ? ... is it all in one [variable] ? ... separated by [#13] (ListBox Items) or [#13][#10] (lines in a text file) ? or commas ?

Once you provide these answers, I can provide the NeoBook script commands to accomplish the task.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Please help me

Postby franco21 » Tue Apr 28, 2015 2:12 pm

The imput is

i read the file text one text for line

Thanks
franco21
 
Posts: 122
Joined: Tue Jan 14, 2014 3:46 pm

Re: Please help me

Postby Gaev » Tue Apr 28, 2015 3:14 pm

franco21:

Try this ...
Code: Select all
SetVar "[InputFile]" "![PubDir]franco21Input.txt"
SetVar "[OutputFile]" "![PubDir]franco21Output.txt"
SetVar "[OutputVar]" ""

FileSize "[InputFile]" "[InputLines]"

Loop "1" "[InputLines]" "[thisLoop]"
   FileRead "[inputFile]" "[thisLoop]" "[thisLine]"
   StrReplace "[thisLine]" "!.test" "" "[thisLine2]" ""
   StrReplace "[thisLine2]" "!.text" "" "[thisOutLine]" ""
   SearchStr "[thisOutLine]" "[OutputVar]" "[FoundPosition]" ""
   If "[FoundPosition]" "=" "0"
      ... not a duplicate
      SetVar "[OutputVar]" "[OutputVar][#13][#10][thisOutLine]"
   Endif
EndLoop
... remove first [#13[#10]
SubStr "[OutputVar]" "3" "999999999" "[NewOutputVar]"
FileWrite "[OutputFile]" "All" "[NewOutputVar]"
Run "[OutputFile]" "" "Normal" "" ""
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Please help me

Postby franco21 » Wed Apr 29, 2015 11:13 am

Thanks Master !!!!
franco21
 
Posts: 122
Joined: Tue Jan 14, 2014 3:46 pm


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron