如何在Blue Prism中复制数据项多行数据并逐行提取?
Hey there! Let's tackle your two Blue Prism questions one by one—super common scenarios, so I’ve got you covered.
1. How to Copy Multi-Line Data into/Between Blue Prism Data Items
Depending on where you're copying from, here are the straightforward methods:
Copying from external sources (Notepad, web pages, etc.) to a Text Data Item
- Use the
Read Textaction from the Utility - Environment VBO. Target the specific element (like a Notepad window's text area) and assign the output directly to your Text data item. This captures all line breaks automatically. - If you’ve already copied the content to your clipboard, use
Get Clipboard Textfrom the same VBO. This pulls the full multi-line string into your data item in one step.
- Use the
Copying multi-line data between Blue Prism Data Items
- Just use a
Calculationstage to assign the source Text data item to the target one (e.g.,[TargetDataItem] = [SourceDataItem]). Blue Prism preserves line break characters (\r\nor\n) by default, so the entire multi-line content will transfer perfectly.
- Just use a
2. Extracting Multi-Line Data Line by Line
Once you’ve got your multi-line data in a Text item, splitting it into individual lines is easy with Blue Prism's built-in functions:
Convert the multi-line text to a list of lines
- Add a
Calculationstage with this expression:Split([YourMultiLineDataItem], Environment.NewLine) - This splits the text at every system-specific line break (works for both Windows and Unix formatting) and outputs a
List of Textwhere each item is a single line from your original data.
- Add a
Iterate over each line with a Loop
- Drag a
Loopstage onto your canvas, set it to iterate over theList of Textyou just created. - Inside the loop, use another
Calculationstage to capture the current line:[CurrentLine] = [Loop Current Item] - Now you can process each line however you need—validate it, write it to a collection, pass it to another process, etc.
- Drag a
Optional: Skip empty lines
- If you want to ignore blank lines, add a
Decisionstage inside the loop with the expression:IsNullOrWhiteSpace([CurrentLine]) - If the result is
True, use aContinuestage to jump to the next iteration immediately.
- If you want to ignore blank lines, add a
内容的提问来源于stack exchange,提问作者monu
相关产品推荐
相关产品推荐

