I need order, order order

(imported topic written by lmpymilk91)

I need to know how many proceding “,” there are before my key word

I would like to see one of the following as my…

USB CD-ROM - 0

or

Hard Drive(C:) - 1

or

Notebook Multibay - 2

or

USB Hard Disk - 3

or

USB SuperDisk - 4

or

USB Floppy - 5

or

Network - 6

String:

USB CD-ROM , Hard Drive(C:) , Notebook Multibay , USB Hard Disk , USB SuperDisk , USB Floppy , Network ,

q:((string values of properties “Value” of it) whose (it as lowercase contains “hard”) of select objects (“Value from HPBIOS_BIOSOrderedList”) of wmi “root\HP\InstrumentedBIOS”)

A: USB CD-ROM , Hard Drive(C:) , Notebook Multibay , USB Hard Disk , USB SuperDisk , USB Floppy , Network Controller , , , , , , , , , ,

(imported comment written by BenKus)

This was tricky:

q: ((if (not exists substring " , " of it) then it else following text of last " , " of it) & " - " & (number of substring “,” of it as string)) whose (preceding text of first " -" of it does not contain “,”) of (preceding texts of substrings " , " of "USB CD-ROM , Hard Drive(C:) , Notebook Multibay , USB Hard Disk , USB SuperDisk , USB Floppy , Network Controller , , , , , , , ")
A: USB CD-ROM - 0
A: Hard Drive(C:) - 1
A: Notebook Multibay - 2
A: USB Hard Disk - 3
A: USB SuperDisk - 4
A: USB Floppy - 5
A: Network Controller - 6

q: ((if (not exists substring " , " of it) then it else following text of last " , " of it) & " - " & (number of substring “,” of it as string)) whose (preceding text of first " -" of it does not contain “,”) of (preceding texts of substrings " , " of (((string values of properties “Value” of it) whose (it as lowercase contains “hard”) of select objects (“Value from HPBIOS_BIOSOrderedList”) of wmi “root\HP\InstrumentedBIOS”)))
A: USB CD-ROM - 0
A: Hard Drive(C:) - 1
A: Notebook Multibay - 2
A: USB Hard Disk - 3
A: USB SuperDisk - 4
A: USB Floppy - 5
A: Network Controller - 6

Ben

(imported comment written by lmpymilk91)

Thank you sir