So far i am trying this solve this issue… but nothing helps me… I have a column with 200 rows with abbrivation text… eg TTF — Turn Tuple Front i am extracting it from pdf and saving it in excel … but while saving there is some extra text is there so i want to remove that one… below is the same file waht i have right now…
Update using For Each activity.
Use Read Range activity to read the data from excel. Output will be saved to datatable DT.
For Each row in DT
Assign Activity, strValue = row("ColumnName")
//get the index of hiphen. If it is not hiphen get the index of space
Assign Activity, intIndex = strValue.IndexOf(" ")
//if index is greater than 4, then there is some value before TTF (assuming all are three letter abbreviations)
//remove the extra value and update the row value
if intIndex > 4 Then
Assign Activity, strUpdatedValue = strValue.SubString(intIndex-4)
Assign Activity, row("ColumnName") = strUpdatedValue
End If
End For
Use Write Range Activity to write the updated datatable to excel.
I used this Regex.Match(row(0).ToString.Trim, “\w+(\s|)—.*”).Value.trim i got the answer what i expect…but in some places there are two “—” lines like this… so i want to trim text before second hypen…
eg: TIRE INFLATION SYSTEM LAMP INDICATOR—LED RTD— Role Tried Divert
I dont want this part TIRE INFLATION SYSTEM LAMP INDICATOR—LED
i am getting the data if there is a space f — front and i am not getting the data if there is no space lsf— left side front
so i need the text if there is space or without space all to be extractted …can you modify the code and send me… to this same expression Regex.Match(row(0).ToString.Trim, “[A-Z]{1,3}(\s|)—([A-Z][a-z]+| )*$”).Value.trim