テキストファイルからリスト変数に値を取り込む方法

こんにちは。UiPath Studio EnterPrise版ユーザの初心者です。
下記のようにデータがVbCrLfで区切られたテキストファイルがあります。

01
02
03
.
.
このテキストファイルからリスト変数に値を取り込む方法をご教授くだい。

Hello @gorby ,
Try the regex Matches Method

System.text.regularexpressions.Regex.Matches(YourString,"^\d+|(?<=\n)\d+")

To Get Count
System.text.RegularExpressions.Regex.Matches(YourString,"^\d+|(?<=\n)\d+").Count

@gorby

You can read whole of text fiel usi g read text file activity into string str…

Then use assign with vararray = str.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries)

Cheers

こんにちは

リスト変数がList<String>型でしたら以下の様になるかと思います。

listStr = strData.Split(vbCrLf.ToCharArray,StringSplitOptions.RemoveEmptyEntries).ToList()

この場合、リスト変数のインスタンス生成不要という認識で合っていますか?

右辺で生成したインスタンスを受け取りますので、個別にNewなどで生成する必要はありません。

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