PDF to CSV Automation


#1

Hello, I am attempting to run an .XAML file that is provided in the automation examples and have a few questions of the methods being used as I am unfamiliar with them and I am not getting the intended output.

PDFText.Replace(“x-none”,Environment.NewLine)

What is the reasoning for the “x-none”?

Also, when running this automation it gives me an error saying ‘Index is out of range’

Unfortunately, I am unable to post screenshots of specific problem so I can provide more in-depth details if needed.


#2

Hello!

The goal of this function is to replace an old string to the new target string.
The Syntax of the Replace function is: stringVariable.Replace(oldText, NewText)

Example:

stringVariable = “Hello world”

stringVariable.Replace(“l”,“p”)

Result: “Heppo worpd”

~~

The “Index is out of range” error might be because you are specifying a page that not exists.

Regards,


#3

I may be wrong, but you don’t get “Index out of Range” exception for replace.

May be you are running a foreach loop or using substring/split etc


#4

Hi Lucas,

Thanks for the explanation. But I still did not understood the use of “x-none”. Could you please explain?


#5

It was just for example purpose. The Replace Method must have 2 arguments (oldText and NewText). In that case, the “x-none” was the text to be replaced by Environment.NewLine :slight_smile: