Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Comma separeted text file

Comma separeted text file

Scheduled Pinned Locked Moved LINQ
questioncsharplinqregexhelp
2 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marca292
    wrote on last edited by
    #1

    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:A2

    I 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

    S 1 Reply Last reply
    0
    • M marca292

      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:A2

      I 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

      S Offline
      S Offline
      savbace
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups