Deleting entire row if text is found at any column of the sequential file - sorting

Using SORT, is it possible to delete a record if a supplied text is in the row? For instance, in the following records any record that contains the text "record" would not be copied.
Suppose:
123456abcdrecord123
111recordaaaaaaaaaa
recordjjjjjj1111111
11111111111abcccccc
So my output should be:
11111111111abcccccc
Can anyone suggest the right control cards for SORT?

Try
OMIT COND=(1,19,SS,EQ,C'record')
Substring search for INCLUDE and OMIT

Related

Copying Data in Excel and replacing in Word Document using UIPATH

I would like to copy data from excel and replace text in word document.
However the cell references that contain data are NOT fixed as it depends on the number of debtors and the number of table rows the user wants.
Any help would be appreciated!
You can try reading the excel data using Read Range Activity and then Lookup into that datatable for the exact values that you want to replace.
And you can use read the Word File and replace the required values in Word file from the Datatable.

data factory special character in column headers

I have a file I am reading into a blob via datafactory.
Its formatted in excel. Some of the column headers have special characters and spaces which isn't good if want to take it to csv or parquet and then SQL.
Is there a way to correct this in the pipeline?
Example
"Activations in last 15 seconds high+Low" "first entry speed (serial T/a)"
Thanks
Normally, Data Flow can handle this for you by adding a Select transformation with a Rule:
Uncheck "Auto mapping".
Click "+ Add mapping"
For the column name, enter "true()" to process all columns.
Enter an appropriate expression to rename the columns. This example uses regular expressions to remove any character that is not a letter.
SPECIAL CASE
There may be an issue with this is the column name contains forward slashes ("/"). I accidentally came across this in my testing:
Every one of the columns not mapped contains forward slashes. Unfortunately, I cannot explain why this would be the case as Data Flow is clearly aware of the column name. It can be addressed manually by adding a Fixed rule for EACH offending column, which is obviously less than ideal:
ANOTHER OPTION
The other thing you could try is to pre-process the text file with another Data Flow using a Source dataset that has no delimiters. This would give you the contents of each row as a single column. If you could get a handle on the just first row, you could remove the special characters.

Power Query - conditional replace/clear entire cell in multiple columns

I'm trying to clear the entire cell if it doesn't contain a given keyword.
I've managed to do this for one column:
Table.ReplaceValue(#"PrevStep",each [#"My Column"], each if Text.PositionOf([#"My Column"],"keyword")>-1 then [#"My Column"] else null,Replacer.ReplaceValue,{"My Column"})
The problem is I need to iterate/repeat that step for a number of columns... the number of columns may vary and column names also may be different every time. I can have all those column names put into a list but I'm not able to use it.
The solution I'm looking for may look like this
for each ColNam in MyColumnsList
Table.ReplaceValue(#"PrevStep",each [#"ColNam"], each if Text.PositionOf([#"ColNam"],"keyword")>-1 then [#"ColNam"] else null,Replacer.ReplaceValue,MyColumnsList)
next
but this is not the VBA code but Power Query M - and of course the problem is with #PrevStep as I would see it like a recursions... again... do not know how to process.
Is the path I follow correct or should it be done some other way
Thanks
Andrew
Unpivot your columns to turn all the columns into two columns. Apply your replacement to the single value column then pivot it back into the original format

Match part of the text and replace with another text in excel

I've data table with list of names which are having few differences. I am trying to change those text to similar name within data table as image in below.
If part of the text in cells in data table are matching with the "Abbreviations" list(Col-AK) then Data table text must replace with the text in "To be replaced" (Col-AL) into "Expected Return Table". I've tried using may different functions to accomplish my ultimate target, but none of them is giving perfect answer.
Can anybody help me with this problem.
I found an answer to my problem. I could do this using below formula.
Step 01:- I've used below static formula at first to identify the dynamic formula
=IF(LEFT(AC2,4)=$AK$2,$AL$2,AC2)
Step 02:- Then I've used Index function to return the first text in abbreviation list which is Iodine by only changing partial of the formula to return only single value avoiding others. Ex: Firstly I considered only about the Iodine in the list. This will only replace Iodine into the expected data table.
=IF(LEFT(AC2,4)=INDEX($AK$2:$AK$11,1),$AL$2,AC2)
Step 03:- Then row_num turned into dynamic and expanded the return text data into range($AL$2:$AL$11) from single($AL$2) using Match & Left function as below.
=IF(LEFT(AC2,4)=INDEX($AK$2:$AK$11,MATCH(LEFT(AC2,4),$AK$2:$AK$11,0)),INDEX($AL$2:$AL$11,MATCH(LEFT(AC2,4),$AK$2:$AK$11,0)),AC2)
Step 04:- Finaly ignore errors using IFERROR Function.
=IFERROR(IF(LEFT(AC2,4)=INDEX($AK$2:$AK$11,MATCH(LEFT(AC2,4),$AK$2:$AK$11,0)),INDEX($AL$2:$AL$11,MATCH(LEFT(AC2,4),$AK$2:$AK$11,0)),AC2),"")
Expected Return Data Table as shown below.

Pentaho-spoon Reading text file

We have a text file with multiple fields and it is being used in different transformations. When I do 'Get Fields' in Text File Input, I get fields as follows:
I don't need all these fields for the next step so I kept only required fields(i.e. 1st, 3rd,18th and 19th) as follows and removed other fields in Text File Input as there are '?' per parameter in the next step.
But it is picking the value of initial fields only.
I even tried using 'Position' as per the file, but no luck. Can anyone please tell me what I am missing here?
Text File Input reads the columns sequentially even though you specify certain column names in the Fields tab.
Select all the fields in the Fields tab of the Text File Input and use Select Values as the next step and there select only the required fields.

Resources