Readfile Strip Line with URL or @

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Readfile Strip Line with URL or @

Post by macroman » Thu Nov 10, 2016 3:42 am

Hi all,

I know how to stringreplace but I'm not sure how to delete the entire url or email addresses... I'm trying to remove all urls and emails from a readfile variable that I placed. My goal is to pretty much delete the entire line with other texts as well... any line that contacts an email or url, delete that line...... any guidence and help on this is greatly appreciated!

macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Re: Readfile Strip Line with URL or @

Post by macroman » Thu Nov 10, 2016 4:44 am

forget regex, which I have a learning curve of learning... i just use whatever MS provided:

Code: Select all

ReadFile>I:\test\desc.txt,desc

Separate>desc,CRLF,descar
If>descar_count>0
  Let>k=0
  Let>newdesc=
  Repeat>k
  Let>k=k+1
  Let>lineout=descar_%k%
  Let>atsign=@
  Position>http,%lineout%,1,addthis
  Position>%atsign%,%lineout%,1,addthis2
  
  If>{(%addthis%>1) OR (%addthis2%>1)}
  //do nothing
  Else
  Let>newdesc=%newdesc%%CRLF%%lineout%
  Endif
  Until>k=descar_count
Endif

Trim>%newdesc%,newdesc
mdl>%newdesc%

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts