cancel
Showing results for 
Search instead for 
Did you mean: 

String manipulation

NayanaH_P
Level 4
How to use string manipulation to read a table from website to collection.

------------------------------
Nayana H P
------------------------------
3 REPLIES 3

PvD_SE
Level 12
Hi Nayana,

I would guess that you could read a table on a website directly into a collection.

If this might not work, and you can only get a string in a data item, then it would be very useful to know what you are trying to read from the website and what you expected outcome looks like. Can you supply us with examples on both?

------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

What i'm facing is i read a table directly from website to collection but in collection how the table is storing means all the different column values are storing in single column in collection.
example table: name  age
                            a         22

now its storing in Collection like : name
                                                              a
                                                            age
                                                              22

but i want to store like a table: name  age
                                                         a        22

------------------------------
Nayana H P
------------------------------

Hi Nayana,

It seems like you're reading the table directly into a collection right now. If you change it to read into a text data item, how does it appear?  I recommend this test to see if you can use the string functions to help:
1. read the table into a single data item of type text (NOT a collection) in debug so you can manipulate the result
2. Open the text data item and click the three dots button next to the Current Value
3. In the box that appears, change the drop down at the top to be XML and review the result

If the data appears clean and properly separated, you can probably use the String functions to split it.  Try using Utility - Strings, "split text" action and see if it separates the data correctly for you.  If it splits the lines but not the rows, you can try using the "Split Lines" action and then on each resulting row do some additional parsing.

Tables can be funky. There's a lot of trial and error to get them read correctly, in my opinion.  You are not alone!

hope this helps

------------------------------
Diane Sanzone
------------------------------