Comma separeted text file
-
Hi, I have a comma separated text file and I want to get all SerialNumber for a specific device. Example: I want to get the SerialNumber for all Device:A1 => 345 and 347
ID:432,Name:Jones,SerialNumber:345,Device:A1
ID:432,Name:Mark,SerialNumber:347,Device:A1
ID:432,Name:Ann,SerialNumber:346,Device:A2I have now solved this problem with a combination of linq, foreach and regex. How can I do this in one linq expression? Best regards Olof
-
Hi, I have a comma separated text file and I want to get all SerialNumber for a specific device. Example: I want to get the SerialNumber for all Device:A1 => 345 and 347
ID:432,Name:Jones,SerialNumber:345,Device:A1
ID:432,Name:Mark,SerialNumber:347,Device:A1
ID:432,Name:Ann,SerialNumber:346,Device:A2I have now solved this problem with a combination of linq, foreach and regex. How can I do this in one linq expression? Best regards Olof
Try to look at this LINQ to CSV library. I briefly explored it and seems it allows to get IEnumerable<T> from *.csv file and then use LINQ against it.