複数のPDFの中のそれぞれのテキストの取得が上手くいきません。


求人票フォルダにある求人票PDFを開いて、会社名を取得したいです。
一社目の会社名の取得には成功しましたが二社目は失敗してしまいます。


エラー内容が上記となります。


「テキストを取得」の厳密セレクター内の上記の赤枠部分をCurrentFile.FullNameにするにはどうすればいいでしょうか?

@oyaken0717

You cannot directly change if you open the window full. Watch below recording which I have taken to help you understand

Sample.zip (4.2 MB)

@oyaken0717

Ideally for this case we go with using read pdf text activity and then use string manipulation like splits or regex to get the required data

Ui is not a recommended way for pdf

Cheers

UiPath.PDF.Activitiesを試してみてください。
うまくいくかもしれません。
1ページ全体のテキストを取得して文字列加工してください。

I’m sorry for the delayed response.
It seems that the way the company name is displayed differs between the first and second documents in the PDF.
Even after adjusting the settings as in the ZIP file you provided, I was able to extract the company name from the first document, but not from the second one.
I’d like to try using the PDF activity instead.

Thank you again for your support.


赤枠を取得するためにはどうすればいいでしょうか?正規表現でしょうか?改行が挟まれていたりで少し混乱しています。

改行コードは区切り文字として便利に使える場合もあるので、改行コードごときで混乱されても困ります。
忙しくなったので回答はこれで最後にさせてください。

私だったらこうすると思います。

1.先頭から〒までの文字列を正規表現で取得
2.1.の結果をSplitメソッドを使って分割する。具体的には、区切り文字を全角スペースか半角スペースにして、大和建設運輸株式会社を取得。Splitメソッドの使い方を下記に例示します。

文字列str=“apple/banana/peach"からbananaを取り出す場合、strを区切り文字”/“で区切り、0始まりのインデックス番号の1番目で区切り文字”/“で挟まれた文字列を取り出す Split(str,”/"c)(1)

おすそ分けとして文字列をASCIIコードで出力するプロジェクトを共有します。改行コードなどの見えない文字を
見える化できます。Windowsの場合、改行コードのASCIIコードは13と10の連結になります。
文字列中の文字の文字コード一覧出力.zip (32.3 KB)

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