Pentaho Filter Regexp Excel Input - regex

Ok, so what I'm trying to do now is take all the information off an Excel Input (all String columns), and then of these columns I want to make an specific filter for one of them, more specific on column NO_BIEN, this specific expression.
[0-9]+(.[0-9][0-9]?)?
I make a Filter Rows operation and click on the REGEXP filter but I don't see where can I paste the expression because all I can see if to add a String.

Place the regular expresssion in the filter-field "value"

Related

Remove Columns in Nifi

I'm trying to remove the last 16 of 18 columns from a Flowfile with CSV-formatted text. I thought my regex pattern would work, but the output is the exact same as the original data. My log doesn't show anything because it thinks it applied the rule correctly, so something must be wrong with my regex. I've included two images below of my flow and the ReplaceText Processor attributes I have set.
Figured it out: I'm not sure if it was my grouping pattern not working or what, but I changed the .* to [,]* and made two separate groups for each of the first two columns, then a group of (.*) for the rest of the columns
^((?:[^,]*,))((?:[^,]*))((.*))
If you already use Record based processing I would suggest that it will be better to use QueryRecord and select only the needed columns using that processor. Doing complex regex is painful for maintainence imo.
The sql for the QueryRecord processor will be:
SELECT column_header1, column_header2 FROM FLOWFILE

How to extract specific strings from a Page url on Google Data Studio?

I am new into google data studio and I would like to extract the first parameter and last parameter of the following url /red-car/2020.75/it-it/window. Therefore, being able to have one category for the car colour (red-car) and one for the region (it-it).
The position of these parameters will be always the same. Is there any way I could extract these?
I have tried to use regex expression but at the moment I was not able to figure out the right way.
Any suggestions?
get the first field (red-car):
REGEXP_EXTRACT(test,r"^[^/]*/([^/]+)")
or if the field contains http://;
REGEXP_EXTRACT(REPLACE(test,"http://","") ,r"^[^/]*/([^/]+)")
get the 3rd field (region: it-it):
REGEXP_EXTRACT(test,r"^[^/]*/[^/]*/[^/]*/([^/]+)")
The r" stands for a regular expression. The round brackets are for the text to be extracted. [^/]* stands for any text without a slash.
See documentation: https://support.google.com/datastudio/answer/7050487?hl=en&ref_topic=7041728

Data validation in excel for ssn, first name, last name, email address not working

I am trying to build a regex in Excel;s data validation. However, it is not working.
Would you please explain how could I put data validation in Excel
I want last name data validation with characters, quote('), space and dot.
=ISNUMBER(MATCH("^[a-zA-Z\s,.']*$",F:F,0))
I am using above formula and, again, it is not working
For SSN, I am using following formula and it is not working
=AND(ISNUMBER(MATCH("/^\d{3}-\d{2}-\d{4}$/",A2,0)),LEFT(A2,1)>=0)
Please help me to build data validation from data tab or VBA script for the data validation.
The MATCH function in Excel is not used for regex matching.
But you do not need it here, it looks like.
To allow only letters and ,.' you could use formula like this:
=ISNUMBER(SUMPRODUCT(SEARCH(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)," ,.'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")))
To validate an SSN try the formula from the guide here
=AND(LEFT(F1,1)>="0",LEN(F1)<10,ISNUMBER(F1))
Some more pointers:
More Data Validation examples
Adding validation to a cell using VBA is described here and using Regex in VBA here, as noted.
Unfortunately, the Match Function is not able to support regex. It can only match a single, constant value.
I suggest you take a look at This very detailed post, which explains beautifully how to use Regular Expressions in Excel.
Other than that, your Regular Expression looks to be in working order - if you get this set up, it should work immediately. Good luck!

How to add regular expression in Excel 2013 tor replace numbers and hashes with comma

My one of my Excel columns has more than 1000 rows records and it has records like blow
Yuichiro Sakai;#75;#Daniel Hinchcliff;#141;#Ali Reza Ehsani;#74
and another column like this:
Irene Bernabeu;#147;#Aferdita Mekuli;#139
the names comes from a database.
What I want is: How can I add a regular expression in Excel 2013 to replace substrings like ;#147;# and ;#74 with a comma?
The Excel search and replace does not support regex, but you can use place holders in your search.
Tested in Excel2010:
Search for
;#*;#
and replace with
,
for the pattern without closing ";#" you have to do a second search.
I found a great regular expression add-on for Excel it worked great
here is the link for http://www.codedawn.com/
you can use it to add regular expression in excel and solve your problem very easily
many thanks to this add-on: http://www.codedawn.com/
Use this pattern
(?>;#\d*)+
and replace with , Demo

Regex Between Two Parentheses

I am trying to import some Oracle SQL data into my MySQL database. At the moment I am using Notepad++ and the regular expression search feature to try and delete the timestamp information stored in each row. I have tried, unsuccessfully, to find the regular expression that would isolate the timestamp portion of this line and was wondering if someone could help.
values (4,21,22,221164,165375,0,0,21,144,0,0,605,to_timestamp('07-JAN-14 10.49.42.000000000 PM','DD-MON-RR HH.MI.SSXFF AM'),to_timestamp('07-JAN-14 10.49.42.000000000 PM','DD-MON-RR HH.MI.SSXFF AM'),'PROG',null);
If you want to remove the to_timestamp(...) you can use the following regex
to_timestamp\(.*?\)
Here you have the working example:
http://regex101.com/r/zK6lC5/1