dsc76 6 Posted July 18, 2011 Report Share Posted July 18, 2011 How can I remove characters such as "[" or "{" (without quotes) from a .txt file? I am scraping pages for content and want to clean them up a bit. Thanks! Quote Link to post Share on other sites
JohnB 255 Posted July 18, 2011 Report Share Posted July 18, 2011 One of the easiest ways may be to use the $replace regular expression feature. If not, then just use the $replace command. Set the contents of the text file to a variable. Then set the same variable again using the $replace command as the content. Let me know if that doesn't make sense and I'll provide an example. John Quote Link to post Share on other sites
dsc76 6 Posted July 18, 2011 Author Report Share Posted July 18, 2011 Hi John,Thanks for the feedback. Yes, please provide an example that would help a lot. Quote Link to post Share on other sites
JohnB 255 Posted July 18, 2011 Report Share Posted July 18, 2011 Ok, here you go. The first part creates the list, saves it to a file and then navigates to that file to show you what is there. It then pauses. Everything after the pause is cleaning the list, and it will show you the new list after it's cleaned.cleaning list.ubot Quote Link to post Share on other sites
dsc76 6 Posted July 19, 2011 Author Report Share Posted July 19, 2011 That looks like it will set me in the right direction. Thanks again! Quote Link to post Share on other sites
Brutal 164 Posted May 14, 2012 Report Share Posted May 14, 2012 Ok, here you go. The first part creates the list, saves it to a file and then navigates to that file to show you what is there. It then pauses. Everything after the pause is cleaning the list, and it will show you the new list after it's cleaned. John, can you put up a ver. 4.* of the example you have here? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.