Hello,

hud_draw "1"
hud_fastswitch "1"
hud_saytext_internal "1"
hud_takesshots "0"
joystick "0"
lookspring "0"
lookstrafe "0.000000"
m_filter "0"
m_forward "1"
m_pitch "0.022"
m_side "0.8"
name "name"
m_yaw "0.022"
model "gordon"
MP3FadeTime "2.0"
MP3Volume "0.620000"
mp_decals "300"
setinfo _bxc "whatever"
net_graph "3"

I need to select only name and setinfo _bxc and to remove quotes from "name" and "whatever"

ps.
I found this code but this is only for specific line, name and setinfo _pwx in my situation may be on different placement.
Thank you

This looks like it could be a .ini file for a game. Am I correct?

       'THIS ASSUMES THAT THE FILE CONTAINS NOTHING BUT THE {NAME VALUE} FORMAT.
        'Read all lines from the file, parse, and then index them.
        Dim sr As New StreamReader("PathToMyFile")
        Dim lstString As New List(Of List(Of String))

        'We will use a datatable to store your objects.
        Dim dt As New DataTable

        Do While sr.Peek <> -1
            lstString.Add(sr.ReadLine.Split(" ").ToList)
        Loop

        'Now add the first column  of each index to the data table as column names...
        For i = 0 To lstString.Count - 1
            dt.Columns.Add(lstString(i)(0).Replace("""", "")) '0th index will be the NAME object.
        Next

        'Next Load The datatable.
        Dim dr As DataRow = dt.Rows.Add

        For i = 0 To lstString.Count - 1
            'This will pair the values with the column.
            'Example: dr("JoyStick") = 0
            dr(lstString(i)(0).Replace("""", "")) = lstString(i)(1).Replace("""", "")
        Next


        'To get the values now, just type something like this:
        'Data table row 0, column JoyStick
        Dim sJoyStickValue = dt(0)("JoyStick")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.