- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-06-19 03:22 PM
I have a collection which contains about 80 columns. Some of the values (across columns and rows) contain the value "-" and I want to replace all of these with nothing. Is there any way to do this? I can see there is a way to do this by each column but looking for a solution that will look for and replace that value within the whole collection without having to do 80 different actions. The only other way I could think would be to loop through and keep sending the different column name each time but again seems very long winded!
------------------------------
Sophie Katherine Smith
HR Systems, Data and Quality Assurance Manager
Arup
Europe/London
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-06-19 05:08 PM
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-06-19 05:05 PM
For Each Column As DataColumn In Input_Collection.Columns
Column.ColumnName=Microsoft.Visualbasic.Replace(Column.ColumnName,"-","")
Next
Output_Collection = Input_Collection
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-06-19 05:08 PM
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-02-21 06:25 AM
Did you ever find af sollution for this? I have the same issue.
------------------------------
Tinna Holst Larsen
Koordinator
IBC International Business College
Europe/Copenhagen
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-02-21 03:55 PM
Here is a quick code stage that removes "-" from columns and rows. Keep in mind this can be done using loops in Blue Prism as well, but I find it faster to write it this way.
foreach (DataColumn c in dtIn.Columns)
{
c.ColumnName = c.ColumnName.Replace("-","");
foreach (DataRow r in dtIn.Rows)
{
r[c.ColumnName] = r[c.ColumnName].ToString().Replace("-","");
}
}
dtOut = dtIn;
------------------------------
Nick LeGuerrier
Senior RPA Developer
MD Financial Management
Ottawa
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-02-21 02:09 PM
Is it possible to alter the code, so it will only apply to the values of a specific column?
------------------------------
Karina Hansen
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-02-21 02:28 PM
In this case columnName is an input which you can provide to the method to find the column name you are looking for.
foreach (DataRow r in dtIn.Rows)
{
r[columnName] = r[columnName].ToString().Replace("-","");
}
dtOut = dtIn;
------------------------------
Nick LeGuerrier
Senior RPA Developer
MD Financial Management
Ottawa
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-02-21 10:09 PM
Hello Nick,
adding this code in a Blueprism code stage brings numerous errors, Can it be written in VB?
------------------------------
Victor Okorie
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-03-21 02:09 PM
My VB is a little rusty, but I think this should do it:
for each r as DataRow in dtIn.Rows
r(columnName) = r(columnName).ToString().Replace("-","")
next
dtOut = dtIn
------------------------------
Nick LeGuerrier
Senior RPA Developer
MD Financial Management
Ottawa
------------------------------