CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    1

    Query info from text file using keyword

    What would be the best way to query and print info from a text file using a certain keyword?

    As an example if I wanted to query the aSN field of a text file and print out the username.

    So an example would be if I exectued my script with 4TJW and have it return the info from user. So it would return test.

    "user" "test" {
    "name" = "test"
    "princName" = "test@local"
    "cn" = "test"
    "ID" = 12345
    "aSN" = "4TJW"
    }

    "user" "test2" {
    "cn" = "test2"
    "sAmname" = "test2"
    "email" = "test2@corp.com"
    "ID" = 422223
    "aSN" = "TRI3"
    }

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Query info from text file using keyword

    That would depend on the format of the file.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

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

Featured