[Solved] How to select specific data between Quotes (“)


this is Ugly, but will eventually work:

COLUMN = 'jksjdksls#$#$@@kskjfjf,"123,456,789" lsnslkdswfnslsjfls'

left(
right(COLUMN,len(COLUMN)-instr(COLUMN,"""")),
instr(
right(COLUMN,len(COLUMN)-instr(COLUMN,"""")),
"""") -1
)

–> 123,456,789

This is what is done:

  • We take this string 'jksjdksls#$#$@@kskjfjf,"123,456,789" lsnslkdswfnslsjfls'
  • find the first occurence of ” with instr(COLUMN,"""") –> returns 24
  • take the right end of the string with. Therefore we need to take the length of the string with len(COLUMN)–> 55 and substract the position of the first ” (24)
  • then we need to find the second ” with instr()in the right string, which we need to create again with right(COLUMN,len(COLUMN)-instr(COLUMN,"""")) and substract 1 for the “.

0

solved How to select specific data between Quotes (“)