Questions tagged [instr]

89 questions
1
vote
2 answers

Oracle: instr+substr instead of regexp_substr

I got this query from another post I made which uses REGEXP_SUBSTR() to pull out specific information from a string in oracle. It works good but only for small sets of data. When it comes to tables that have 300,000+ records, it is very slow and I…
CreationSL
  • 55
  • 1
  • 11
1
vote
1 answer

Remove all after certain character/phrase SQLITE

Table in SQLITE, want to simple way to delete everything to a right of a set phrase/character in the Company_name_ column, in this case everything after "LLC": Company_name_ Example LLC $42 Example llc,klp Example LLc…
S. Galvin
  • 21
  • 1
  • 3
1
vote
1 answer

Problem with Scripting.FileSystemObject and INSTR and IF THEN in VBA code

I do not understand why this does not work xSource = vrtSelectedItem '<<== C:\Users\Me\Desktop\Document01.pdf Set FSO = VBA.CreateObject("Scripting.FileSystemObject") If Not InStr(xSource, ".jpg") Or Not InStr(xSource, ".bmp") Or Not…
Jasco
  • 225
  • 3
  • 8
1
vote
1 answer

SQLite Instr provides different value than expected

I'm trying to pull a substring in a query using instr. The following command: SELECT instr(ZSYNCPAYMENT, '{"t') FROM ZPAYMENT; provides a result of 64. I copied and pasted the output of SELECT ZSYNCPAYMENT FROM ZPAYMENT into a hex editor and…
SnakeDoc65
  • 91
  • 7
1
vote
2 answers

Substring regex matching in mysql

I've one complex question that been struggle me for couple hours and seeking help from mysql expert. :) Thank you in advanced. Table : t1 ; Column: name Given table: name ----- $abc|def|$cde efd|$acd $gcb|$bvv|ggg Expected outcome (pull only the…
amine
  • 449
  • 1
  • 5
  • 12
1
vote
2 answers

duplicate oacle sql value

I have an ENTITY field with different values like this: Orange/OBS/SCE/CSO/ESC/STI/CSE/TE Orange/ODT/GSE Orange/FGI Orange/DSE/FGE/CSO/ If we take the first example: Orange OBS/SCE/CSO/ESC/STI/CSE/TE I would like to have this result in the end…
Juji
  • 11
  • 6
1
vote
1 answer

python-curses doesn't register instr()

I'm writing a doodle-jump terminal game for which I need to know whether or not the player has hit an obstacle. For that I'm using the instr() function to tell me if an obstacle was hit. But it doesn't register and also during debugging it doesn't…
Phil
  • 321
  • 1
  • 17
1
vote
2 answers

Instr function in Spark with 3 arguments

I have a problem with using instr() function in Spark. The definition of function looks like below: instr(Column str, String substring) I want to use instr in the same way as it is in Impala like: instr(Column str, String substring, Int [position])…
HEMANT PATEL
  • 77
  • 1
  • 11
1
vote
2 answers

PROGRESS DB extract string between semi colons - INSTR Function error

I'm querying a Progress DB via an OpenQuery in MS SQL Server. I have a field (addr) that contains a string value in the below format: text123; text 456; text 789; text 1011 I need to extract each value before the semi colon ; for separate…
Michael
  • 2,507
  • 8
  • 35
  • 71
1
vote
2 answers

Can I use regular expressions, the Like operator, and/or Instr() find the index of a pattern within a larger string?

I have a large list (a table with one field) of non-standardized strings, imported from a poorly managed legacy database. I need to extract the single-digit number (surrounded by spaces) that occurs exactly once in each of those strings (though the…
ErrorMeck
  • 43
  • 8
1
vote
1 answer

InStr (VBA function) can't find vbCrLf

I would like to get a string up to the newline. For this I am trying to use InStr(text, vbCrLf), but the function returns 0. MsgBox displays the text considering the line jump. Why it returns 0? ' VBA InStr(text, "/r") ' returns 0 InStr(text, "/n")…
Manoel Gumes
  • 11
  • 1
  • 2
1
vote
0 answers

invalid length parameter passed to the left or substring function charindex

I need to translate the Oracle SQL-code select URL, TO_NUMBER(NVL( substr(URL,INSTR(URL,'pageId=') + 7, INSTR(URL,'&')- (INSTR(URL,'pageId=') + 7) ) , substr(URL,INSTR(URL,'pageId=') + 7) )) PageId from remotelink WHERE…
bent
  • 11
  • 2
1
vote
2 answers

How to search for multiple substrings using instr()

I'm trying to get the position of a file extension in a given string using instr(). This could be a number of possible extensions, so I need search for multiple substrings (eg. "jpg", "mp4"...). I've tried an OR statement, eg. instr(string,"jpg" OR…
0
votes
2 answers

If cell contains partial match of multiple text strings, then apply conditional formatting VBA

Currently able to do a VBA search on a column range like H:H and apply conditional formatting if any cells in H:H has a partial match against cell A1, which might be "LTD". However, i'm struggling to find a code that allows me to expand partial…
0
votes
0 answers

Using InStr() in VBA to flag emails

I'm trying to make a macro that will go through a list of emails and flag potential problems by changing their color. I was trying to do it by using the Like function, but I forgot that it's case sensitive and the resulting code looks kind of big…
MRDoubleyou
  • 45
  • 1
  • 8