Results 1 to 8 of 8

Thread: [RESOLVED] Best way to find info NOT in a list using LINQ?

Threaded View

  1. #1

    Thread Starter
    Member din0's Avatar
    Join Date
    Aug 2011
    Location
    Indianapolis
    Posts
    34

    Resolved [RESOLVED] Best way to find info NOT in a list using LINQ?

    For a class project I am supposed to search through the attached file, and write to a new file the years between 1789 and 2009 that are not present in the fifth field. What is my best bet for determining what years are not present?

    So far I have this

    Code:
        Dim justices() As String = IO.File.ReadAllLines("Justices.txt")
    
        Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click
            Dim queryAppointments = From line In justices
                                      Let year = line.Split(","c)(4)
                                      Select year
    
            Dim queryNoAppointments = From line In justices.Except(queryAppointments)
    
    
        End Sub
    End Class
    I'm kind of stuck after that. :/


    Should I make an array of integer between 1789 and 2009, then search for every year in the file, then set a flag to false if not found; is there a simpler way to accomplish this using LINQ?

    Thanks in advance for any help, I'm still shaky at best with my programming and fairly new.
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width