I have a range of cells B5:I5, and I need to select the cell which starts with 'R'. Tried with query, but can't the result.
Could somebody help please?
try:
=FILTER(B5:I5; REGEXMATCH(B5:I5; "^R.+"))
or:
=TRANSPOSE(QUERY(FLATTEN(B5:I5); "where Col1 starts with 'R'"))
or:
=TRANSPOSE(QUERY(FLATTEN(B5:I5); "where Col1 matches '^R'"))
Related
I'm looking to add a column with a default value in superset.
All rows will be filled with the value "ABC".
Are there anyone can help me?
Just use single '.
SELECT *,
'ABC' as "new_column"
FROM BDD
I'm using the formula:
=ARRAYFORMULA(QUERY(TRIM(IMPORTXML("https://www.livescores.com/","//div[#class='content']//div[contains(#class,'row-gray')]")),"Where not Col1 contains 'Postp|Canc' "))
But for some reason 'Postp|Canc' not removing the lines that contain such values, what am I doing wrong?
| is a regex thing and in query only matches is regex attribute. use:
=ARRAYFORMULA(QUERY(TRIM(IMPORTXML("https://www.livescores.com/",
"//div[#class='content']//div[contains(#class,'row-gray')]")),
"where not Col1 matches '.*Postp.*|.*Canc.*'"))
or:
=ARRAYFORMULA(QUERY(TRIM(IMPORTXML("https://www.livescores.com/",
"//div[#class='content']//div[contains(#class,'row-gray')]")),
"where not Col1 contains 'Postp'
or not Col1 contains 'Canc'"))
In this answer, I would like to propose to modify the xpath. The modified xpath is as follows.
Modified xpath:
//div[#class='content']//div[div[#class='min'][not(contains(text(),'Postp') or contains(text(),'Canc'))]]
Modified formula:
=IMPORTXML("https://www.livescores.com/","//div[#class='content']//div[div[#class='min'][not(contains(text(),'Postp') or contains(text(),'Canc'))]]")
Result:
Reference:
IMPORTXML
I'm working on a large Google spreadsheet with key phrases, strings of text, in column A. I want to search column A based on a list of keywords that live in another sheet. When a keyword matches a word in a string in column A, I want to print that word in an adjacent cell to column A.
Here's a simple spreadsheet to work with that I think demonstrates what I'm trying to do.
https://docs.google.com/spreadsheets/d/1tNcroABVP0UdP4CiJldxLZgdrJF33TYT4mL1DZJfD1Q/edit?usp=sharing
I want to print that word in an adjacent cell to column A
=ARRAYFORMULA(IFNA(REGEXEXTRACT(A2:A, LOWER(TEXTJOIN("|", 1, 'KEYWORD LIST'!A2:A)))))
Try with this (put at B2):
=arrayformula(if(ISNUMBER(find(
transpose({'KEYWORD LIST'!$A$2:$A$6}),A2:A6)),
transpose({'KEYWORD LIST'!$A$2:$A$6}),""))
I am trying to replace the string using regexp_replace in PLSQL and not getting desired output. i am new to this. please advise where i am going wrong.
names := 'table_200_file1_record1.column1 table_200_file2_record2.column2'
SELECT REGEXP_REPLACE(names,'([table_200]*[.]*){1,}','') FROM DUAL;
Desired output: (i want to remove everything before . operator which is starting with table_200)
column1 column2
You need to replace everything that's not a dot after table_200, up to the first dot you find, i.e.:
SELECT REGEXP_REPLACE('table_200_file1_record1.column1 table_200_file2_record2.column2','table_200[^\.]+(\.)','') FROM DUAL
I want to be able to search a pattern like 'CREATE TABLE ' followed by any expression include newline and ending with );
So it should be able to select following 2 create table stamtement one after other.
create table tab1 ( col1 number,
col2 date);
create table tab3 ( col1 number,
col2 date,
col3 number);
I did tried create table .* but I am not able to include newline .
Thanks.
this should do:
create table [^;]*;
check the matches newline checkbox