Jump to content
UBot Underground

Question about loading to a list from a file


Recommended Posts

Hi guys

 

I have a question about a list from file.

 

When i load my csv into a list and assign it to a list

 

For example i have

 

user1@hotmail.com

user2@hotmail.com

user3@hotmail.com

user4@hotmail.com

 

I want than to manipulate this list and only have this left in it

 

user1

user2

user3

user4

 

I know how to create a regex expression for this. I know how to manipulate a list and put it in a variable but than i have one long variable with one name.

 

How do you either create a new list or update the list that is loaded from a file.

 

Thank you for the help

Link to post
Share on other sites

you would add the first item of the list (user1@hotmail.com) into a variable, #replace_email

 

then you do the regex on that variable to remove everything after the @

 

then you add the new (user1) variable into a new list

 

then remove from the original list (user1@hotmail.com)

 

stick the above in a loop while (original list total > 0 )

 

done

Link to post
Share on other sites

Thank you very much :)     This worked perfect.

define List_manipulation {
    add list to list(%accounts, $list from file(#file_open), "Don\'t Delete", "Global")
    loop while(%accounts > 0) {
        set(#replace_email, $replace regular expression($list item(%accounts, 0), "@hotmail.com.*", $nothing), "Global")
        add item to list(%accounts_processed, #replace_email, "Delete", "Global")
        remove from list(%accounts, 0)
    }
  • Like 1
Link to post
Share on other sites

Here is another angle of attack...

 

set(#replace$replace($read file("{$special folder("Desktop")}\\replace test.txt"), "@hotmail.com"$nothing), "Global")
add list to list(%replaced$list from text(#replace$new line), "Delete""Global")

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...