Skip to content
Advertisement

How can i find item number and quantity from this raw text

I would like to select item number and quantity from a text, I’ve been stuck a bit, but have tried something to search for _______ in the text and replace/delete characters, but I’m not really moving forward so hope someone can help me with.

The raw text is:

JavaScript

The text may vary, for example, the first character is a line number (which I do not need for anything) which can be 1,2,3 ..or also.. 100,101, etc. so this must be taken into account.

I only need item number and quantity (the bold ones) from the text to use for database search, so my output schould be something like:

JavaScript

Advertisement

Answer

You could take advantage of the explode() function:

JavaScript

gives:

JavaScript

See here for a live demo.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement