vbscript - detect word

ferrarista
ferrarista used Ask the Experts™
on
Hi guys,

I have a csv file that has three words within quotes and separated by coma.

"word1", "word2", "word3".

these words can have different lenghts, but I need to retrieve the third one, without the quotes.
I have already identified the correct line (because the csv file could have many lines), but once I identify the line containing the word I need (which is actually the first one), I need to collect the third one. Do I need a regular expression ?
How could I accomplish that ?

Thanks!!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Managing Director/Excel VBA Developer
Distinguished Expert 2018
Commented:
Hi,

It can be achieved with Excel Formula, assuming your string is in A2, try below formula:
=TRIM(RIGHT(SUBSTITUTE(TRIM(MID(A2, FIND(" ", A2, FIND(" ", A2)+1)+1,256)),"""",REPT("",99)),99))

Open in new window

Author

Commented:
But I'm using a plain text file, not excel.... would that work ?
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Open csv in Excel. change the cell and save it. Then re-open in text file, that will be gone.
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
No comment has been added to this question in more than 14 days, so it is now classified as abandoned.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial