Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Search data problem

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Search data problem

    Hello guys
    I have a text file and the data are as below

    ID Name Brand
    1 a Dell
    2 b Dell
    3 c HP
    4 d HP
    5 e MSI

    How can I search brand(dell) and display at jTable???

    (I can search Name and can able to display at jTable. But I can't able to search brand with the same coding)

    help me guys


  2. #2
    Member
    Join Date
    Feb 2013
    Location
    earth
    Posts
    88
    Thanks
    12
    Thanked 9 Times in 9 Posts

    Default Re: Search data problem

    Use a regular expression '^Dell$' to search for that exact pattern in field $3 using AWK.

  3. #3
    Member
    Join Date
    Oct 2013
    Location
    Saint-Petersburg, Russia
    Posts
    33
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default Re: Search data problem

    By the way, perhaps it is time to start using database instead of text file. There are a few embeddable java database which could be used simply as libraries - H2, Apache Derby (JavaDB) etc.

Similar Threads

  1. Search and delete data to a Text file in GUI
    By Nathanlll in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 24th, 2013, 04:36 PM
  2. Replies: 8
    Last Post: December 4th, 2012, 04:58 AM
  3. Search data....
    By mcajavaprogramer in forum AWT / Java Swing
    Replies: 3
    Last Post: May 3rd, 2012, 08:26 AM
  4. Replies: 2
    Last Post: February 17th, 2012, 02:13 AM
  5. [SOLVED] i cant make a java jar file which can search data from mysql
    By talha07 in forum JDBC & Databases
    Replies: 6
    Last Post: January 20th, 2011, 06:09 AM