Find and replace Version 2 (.Net)

Action group: Excel 


Description

The action finds and replaces the value in the Excel-document.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with an Excel document.Robin.ExcelExcel contextYes
To findValue to be found.Robin.String
Yes
Replace withValue to replace the required text with. If the field is not filled in, the found text will be cut out of the cell.Robin.String
No
Replace optionText replacement mode.Robin.String
No
Case sensitiveParameter that makes the search case-sensitive. If the value is «true», the case of the letters of the required value will be taken into account.Robin.BooleantrueNo
Search methodThe rule that will be taken into account when searching.Robin.String
No
Results
ResultDictionary with modified cells, where the key is the index of the cell, the value is the value of the cell.Robin.Dictionary

Special conditions of use

Examples of action practicing in different cases: 

No.

Essence of the test

Table

Parameters

Resulting table

1

Replace all matches +

Do not count the register

  • "Context" fill in
  • "To find" - Moscow
  • "Replace with" - Perm
  • "Replace option" - Replace all matches
  • "Case sensitive" - false
  • "Search method" - Full text search

2Replace first match

  • "Context" fill in
  • "To find" - Moscow
  • "Replace with" - Perm
  • "Replace option" - Replace the first matches
  • "Case sensitive" - true
  • "Search method" - Full text search

3Count register

  • "Context" fill in
  • "To find" - MOSCOW
  • "Replace with" - Perm
  • "Replace option" - Replace all matches
  • "Case sensitive" - true
  • "Search method" - Full text search

No changes.

Desired phrase not found.

4

Text not found

Failed full-text search method

  • "Context" fill in
  • "To find" - Nizhniy
  • "Replace with" - Perm
  • "Replace option" - Replace all matches
  • "Case sensitive" - false
  • "Search method" - Full text search

No changes.

Desired phrase not found.

5

Successful

Full-text search method


  • "Context" fill in
  • "To find" - Nizhniy Novgorod
  • "Replace with" - Perm
  • "Replace option" - Replace all matches
  • "Case sensitive" - false
  • "Search method" - Full text search

6By inclusion

  • "Context" fill in
  • "To find" - Nov
  • "Replace with" - ""
  • "Replace option" - Replace all matches
  • "Case sensitive" - false
  • "Search method" - Search by inclusion

7Starts with specified value

  • "Context" fill in
  • "To find" - Nizhniy
  • "Replace with" - "Veliky"
  • "Replace option" - Replace all matches
  • "Case sensitive" - false
  • "Search method" - Starting with text

8Ends with specified value

  • "Context" fill in
  • "To find" - g
  • "Replace with" - "Ufa"
  • "Replace option" - Replace all matches
  • "Case sensitive" - false
  • "Search method" - Ending with text

Example of use

Task

There is a table with numbers, replace the values 22 with 2.

Solution

Use the "Open", "Find and replace", "Save" actions.

Implementation

  1. Assemble a robot scheme with the actions.

2. Set the "Open" action parameters.

3. Set the "Find and replace" action parameters.

4. Set the "Save" action parameters.

5. Click "Start" and see the result.

Result

The program robot completed successfully.

The desired replacement was made.


  • Нет меток