Jump to content
UBot Underground

Removing Breaks Or Carriage Returns From Table.


Recommended Posts

Hi,

 

This is my first time posting a questions as I've usually been able to find what I'm looking for online. 

 

My bot is scraping a table.  When I scrape the table, I'm copying two of the columns to a list. 

 

Within each list item is an array of values that are line followed by line breaks.  Ideally I would like to replace the line breaks with a "," or a "SPACE"  . 

 

 

For example, a given field in the table or list item will contain

 

01CA

02DW

0319

0423

0431

 

 

I need it to be 01CA, 02DW, 0319, 0423, 0431.  

 

I'm hopeful someone here can point me in the right direction.

 

 

Link to post
Share on other sites

my regex sucks but this should work

set(#item,"01CA

 02DW

 0319

 0423

 0431","Global")
set(#newItems,$replace regular expression(#item,"\\s+|/n",","),"Global")
  • Like 1
Link to post
Share on other sites

No need |/n  just \s+

set(#item,"01CA

 02DW

 0319

 0423

 0431","Global")
set(#newItems,$replace regular expression(#item,"\\s+",","),"Global")

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