Jump to content



Photo

Replacing The Tab Character In A List Item


  • Please log in to reply
1 reply to this topic

#1 stever

stever

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 66 posts
  • OS:Windows 10
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Standard Edition

Posted 12 June 2019 - 05:44 AM

I have scraped a web page into a list, but the problem is that each item in the list has two strings separated by a tab character. (I thought they were spaces at first but they're not.)

 

I want to create a new list with all the strings as separate items, so thought that this would work:

 

  set(#innerloopcounter,0,"Global")

            loop($list total(%OriginalList)) {
                add list to list(%NewList,$list from text($list item(%OriginalList,#innerloopcounter),\t),"Delete","Global")
                increment(#innerloopcounter)
            }

 

But the \t for tab character is considered illegal, so don't know what to do next, but think it might have to involve regex...

Any better ideas?

 



#2 stever

stever

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 66 posts
  • OS:Windows 10
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Standard Edition

Posted 12 June 2019 - 08:09 AM

Answering my own question: I used "replace regular expression" to replace \t with a comma, then used the comma as the delimiter 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users