Dec 28 2023 06:53 PM
Hello,
I am reading pdf information and I already got the text I was looking for, but this one has two characters at the beginning that I can't delete.
Apparently, they are not simple spaces, because the TRIM function did not work for me. I am inquiring about which characters are with ASC, and supposedly they are 10 and 13. Then I replace them with Replace and it doesn't seem to work.
Any idea how to fix this please?
Thank you very much for your help and time.
Dec 29 2023 04:38 AM
Solution@LuisElCaminante You've already done everything correct to identify the two leading characters (13 = Carriage Return; 10 = Line Feed), and the Replace method is working. The only mistake you've made is to use documento as the Expression argument when defining dc both times... the second time, dc should have been used as the Expression argument.
You really only need one variable, documento, which can be redefined and reduced after each use of Replace. For example:
documento = Trim(vector(0))
documento = Replace(documento, Chr(13), "")
documento = Replace(documento, Chr(10), "")
Or you can combine all three steps into one line:
documento = Replace(Replace(Trim(vector(0)), Chr(13), ""), Chr(10), "")
I hope that helps. Cheers!
Dec 29 2023 07:13 AM
Dec 29 2023 04:38 AM
Solution@LuisElCaminante You've already done everything correct to identify the two leading characters (13 = Carriage Return; 10 = Line Feed), and the Replace method is working. The only mistake you've made is to use documento as the Expression argument when defining dc both times... the second time, dc should have been used as the Expression argument.
You really only need one variable, documento, which can be redefined and reduced after each use of Replace. For example:
documento = Trim(vector(0))
documento = Replace(documento, Chr(13), "")
documento = Replace(documento, Chr(10), "")
Or you can combine all three steps into one line:
documento = Replace(Replace(Trim(vector(0)), Chr(13), ""), Chr(10), "")
I hope that helps. Cheers!