Getting issue while parsing data from csv file

c:\BigFixLogs\sample.csv

Name,MemoryUsageMB
AggregatorHost,2.71
ai,8.45
ai,8.47
ai,0.33
AnyDesk,3.14
AnyDesk,4.51


q: (item 1 of it) of (substrings separated by "," of it) whose (item 0 of substrings separated by "," of it as trimmed string = "MemoryUsageMB") of lines of file "C:\BigFixLogs\sample.csv"
E: The tuple index 0 is out of range.

Substrings separated by “…” returns substrings as individual items (i.e. like they are on a new line), not as a tuple (multiple objects within a single item).

q: (substrings separated by "," of it) of lines of file "C:\BigFixLogs\sample.csv"
A: Name
A: MemoryUsageMB
A: AggregatorHost
A: 2.71
A: ai
A: 8.45
A: ai
A: 8.47
A: ai
A: 0.33
A: AnyDesk
A: 3.14
A: AnyDesk
A: 4.51
T: 1.503 ms
I: plural substring

If you want to use a tuple, you have to define your tuple and then you can add (item 1 of it) in front:

q: (preceding text of first "," of it, following text of first "," of it) of lines of file "C:\BigFixLogs\sample.csv"
A: Name, MemoryUsageMB
A: AggregatorHost, 2.71
A: ai, 8.45
A: ai, 8.47
A: ai, 0.33
A: AnyDesk, 3.14
A: AnyDesk, 4.51
T: 1.991 ms
I: plural ( substring, substring )

OR the other option is to use tuple string item but please note their default delimiter is ", " not “,”, so you’d need to change it first.

q: tuple string items 1 of (concatenation ", " of substrings separated by "," of it) of lines of file "C:\BigFixLogs\sample.csv"
A: MemoryUsageMB
A: 2.71
A: 8.45
A: 8.47
A: 0.33
A: 3.14
A: 4.51
T: 0.850 ms
I: plural string
2 Likes