theninjamanz 29 Posted May 31, 2011 Report Share Posted May 31, 2011 IS there a piece of regex that will remove all carriage returns in a file. I have a series of text items that always scrape from a webpage like this: text item 1 text item 2 text item 3 text item 4 what i want to have is a final list that looks like this: text item 1text item 2text item 3text item 4 I've tried adding the items to a list and using regext to remove the line breaks but I can't get it to work. I've also tried adding the entries to a new list and remove duplicates, but it looks like CARRIAGE returns are not considered duplicates. I've also tried sorting the list to, but that doesn't work. Anyone got any good ideas? Quote Link to post Share on other sites
UBotBuddy 331 Posted May 31, 2011 Report Share Posted May 31, 2011 You can do this without regex by searching for $newline and replacing it with $nothing. If you have the Pro/Dev version. Please change your Profile info to reflect your version of UBot and your system environment. Thanks Quote Link to post Share on other sites
yodayick 2 Posted August 1, 2011 Report Share Posted August 1, 2011 should search for 2 $newline and replacing it with 1 $newline. Quote Link to post Share on other sites
JohnB 255 Posted August 1, 2011 Report Share Posted August 1, 2011 You can also loop through it and do something like this: If--->$text length($list item) = 0 Then---> remove list item But for regex, the string for a carriage return is \r John 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.