Jump to content
UBot Underground

[REQ] Replace certain content in file.


Recommended Posts

Here's the situation:

 

1- I scrape youtube video descriptions and save to a file.

 

2- Now, I want to use those scraped descriptions in my content submitter, but many of them have url's.

 

3- I need a way to delete or replace ALL urls within that file, but i have no idea what the url will be or where it will be in the file.

 

3a- Clarification... This is a bot for other people to use, so I can't know what descriptions they might scrape, so the question is how do i find/replace text (url's in this case) in a file when i do not know exactly what the text is, or exactly where it is?

 

Any help greatly appreciated.

Link to post
Share on other sites

If you are only trying to replace urls's, you should be able to use regex for that. In Ubot you would use the $replace regular expression function.

 

Here is an example of a regex string looking for urls within full text:

 

\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|$!:,.;]*[A-Z0-9+&@#/%=~_|$]

 

 

John

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...