Copying address to excel without changing the format

Hi, I want to copy the text and display the text as the same format in web but when I copy to excel, it display my address in one line instead of two lines.

For example in web, the address is displayed as:
19 South Lawrence St.
Bolingbrook, IL 60440

In excel, the address is displayed as:
19 South Lawrence St.Bolingbrook, IL 60440

If you look at the actual value of the data from the web page, the line break will be a <BR> tag which isn’t recognized by Excel. You’ll have to use Replace to change "<BR>" to VbCrLf.

how do I do that to specifiy the string format to be written in excel?

It’s not about specifying string format in Excel. It’s about adding a proper line break to the string before writing it to Excel.

Hi @Vivian_Thian

While reading the data from Web, can you try and print it in the logs, do you see any breaks in the data while its printed?
If so you can just identify the breaking identifier and use strData.Replace(“identifier”, Environment.Newline)
Or some other value which should be identified by excel.

Thanks and Happy Automation!

Hi,

How do I define the identifier of different data but they are in the same format from the web page.

For example,
The address is all in the format where address is first line, unit number second line and postal code third line. How do I break it?

Regards,
Vivian

Hi,

If you currently use GetText activity, can you try GetAttribute activity as the following?

image

We will be able to get html source and there may be some tag such as BR to break line.

Regards,

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