denrich 4 Posted February 20, 2014 Report Share Posted February 20, 2014 Hello UBoters I need help on adding speech marks before and after strings from a file: Example: Before: word oneword twoword threeword four After: "word one""word two""word three""word four" Thanks for the help Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted February 20, 2014 Report Share Posted February 20, 2014 one way is to loop through that list and put variable between quotes like this set(#word one, "word one", "Global")set(#word one1, "\"{#word one}\"", "Global") you can even save it that way if you scraping it like set(#word one, "word one", "Global")add item to list(%list, "\"{#word one}\"", "Delete", "Global") TC 1 Quote Link to post Share on other sites
UBotDev 276 Posted February 20, 2014 Report Share Posted February 20, 2014 The other way is with a single regex replace command: set(#LIST, "\"{$replace regular expression("word one word two word three word four", "\\n", "\"{$new line}\"")}\"", "Global") Notice that this won't work if your word contains new line character (but I think that's not your case). Quote Link to post Share on other sites
denrich 4 Posted February 20, 2014 Author Report Share Posted February 20, 2014 The other way is with a single regex replace command: set(#LIST, "\"{$replace regular expression("word one word two word three word four", "\\n", "\"{$new line}\"")}\"", "Global") Notice that this won't work if your word contains new line character (but I think that's not your case).The function speech marks seem to change $new line function to just "new line" when I edit the $replace regular expression function the speech marks are not there anymore. 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.