Convert table to list with a certain format

Hello guys, I want to scrape a website for multiple items with their specifications and I want to extract this type of table into a list with the following format: Jaw Depth (In.):5/8 | Jaw Height (in.):1-1/4 | Jaw Width (In.):4-1/2 | ETC…
But each item has a different number of specification:


What approach is the easiest and the best for this? Thank you :slight_smile:

1 Like

Hey @Ionut_Frincu

I hope you would have already scrapped it into a table from website.

Now let’s convert it into a list,

Assuming dt_Data is your variable.

dt_Data.AsEnumerable.Select(Function(row) String.Join(":", row.ItemArray))

Hope this helps you.

Thanks
#nK

Hello @Nithinkrishna thanks for your response, what about if I want to conver this table to a string with " | " as delimiter for each row? Thank you ::slight_smile:

1 Like

Hey @Ionut_Frincu

You can just replace the : from the above code snippet with |

Thanks
#nK

Actually I want to convert this type of table into a single line string with each row delimited by " | ":

Stock Number 11706
Weight (Lbs.) 74
Jaw Depth (In.) 2
Jaw Width (In.) 5
Opening Capacity Max (In.) 5

this format : Stock Number 11706 | Weight (Lbs.) 74 | Jaw Depth (In.) 2 | Jaw Width (In.) 5 | Opening Capacity Max (In.) 5

do you have any idea?
Thank you in advance!

1 Like

Hey @Ionut_Frincu

String.Join(" | ", dt_Data.AsEnumerable.Select(Function(row) String.Join(" ", row.ItemArray)))

Hope this helps

Thanks
#nK

Yes, this is what I was looking for. Thank you my friend!

Best regards!

1 Like

Cool @Ionut_Frincu

Enjoy it :slightly_smiling_face:

can you please share workflow I am getting error

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.