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 9 of 9

Thread: Printing name tags from a csv file

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Printing name tags from a csv file

    Hi All,

    I'm from South Africa and am new to the Java scene.

    I would like information to compile a simple program to print name cards from a csv file.

    I have pre-printed paper for use on a dot-matrix that has a space for certain fields to go on it. The paper has 4 rows and 5 columns of tags (i.e 20 name tags)

    My csv file is formatted in the following manner : name,surname,company name,delegate number - but without headings.

    Any help on the matter would be great.

    Thanks
    Ian


  2. #2
    Member DanBrown's Avatar
    Join Date
    Jan 2011
    Posts
    134
    My Mood
    Confused
    Thanks
    1
    Thanked 12 Times in 12 Posts

    Default Re: Printing name tags from a csv file

    edited for content...
    Last edited by copeg; January 24th, 2011 at 09:38 PM.
    Thanks and Regards
    Dan Brown

    Common Java Mistakes

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Printing name tags from a csv file

    Hello infoman.

    Welcome to the Java Programming Forums.

    DanBrown, thanks for your help with this but please be careful with the 'spoonfeeding'
    Providing full solutions for newbies is something we are trying to stamp out here now.

    We believe that providing full solutions straight away actually hinder the learning process. I think the best approach is to provide a helping hand in how to move forward and then let the OP reply with any questions they have.

    Just a thought for the future!
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  4. #4
    Member DanBrown's Avatar
    Join Date
    Jan 2011
    Posts
    134
    My Mood
    Confused
    Thanks
    1
    Thanked 12 Times in 12 Posts

    Default Re: Printing name tags from a csv file

    you are right.I will take care of this in future.
    Thanks and Regards
    Dan Brown

    Common Java Mistakes

  5. The Following User Says Thank You to DanBrown For This Useful Post:

    JavaPF (January 24th, 2011)

  6. #5
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Printing name tags from a csv file

    Thank you for your understanding Dan.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  7. #6
    Member
    Join Date
    Dec 2010
    Posts
    46
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Default Re: Printing name tags from a csv file

    Quote Originally Posted by DanBrown View Post
    [highlight=Java]
    			String strLine = "";
    			StringTokenizer st = null;
    			int lineNumber = 0, tokenNumber = 0;
    why StringTokenizer? A simple split will do. Also , StringTokenizer is outdated. The Scanner has useDelimiter() for these things.

  8. #7
    Member
    Join Date
    Dec 2010
    Posts
    46
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Default Re: Printing name tags from a csv file

    Quote Originally Posted by JavaPF View Post

    We believe that providing full solutions straight away actually hinder the learning process.
    you should remove the post then. If you leave it , you are telling people you don't mind , even though you advocate it.

  9. #8
    Member DanBrown's Avatar
    Join Date
    Jan 2011
    Posts
    134
    My Mood
    Confused
    Thanks
    1
    Thanked 12 Times in 12 Posts

    Default Re: Printing name tags from a csv file

    yes we can also use split function.
    Thanks and Regards
    Dan Brown

    Common Java Mistakes

  10. #9
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Printing name tags from a csv file

    Quote Originally Posted by JavaHater View Post
    you should remove the post then. If you leave it , you are telling people you don't mind , even though you advocate it.
    This has been done. We will be posting new forum guidelines soon and enforcing the rules as requried. Thanks.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. PrintStream not printing in file
    By rrahulvverma in forum File I/O & Other I/O Streams
    Replies: 6
    Last Post: November 2nd, 2010, 05:32 PM
  2. [SOLVED] Printing Array without printing empty elements
    By CarlMartin10 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 12th, 2010, 02:41 AM
  3. printing output to console & to a text file at the same time...
    By prasanna in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: August 26th, 2009, 03:43 AM
  4. [SOLVED] Java code to embedding xml tags at start and end of file
    By John in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: April 30th, 2009, 03:02 PM
  5. [SOLVED] Parsing ID3 tags from mp3
    By John in forum Java Theory & Questions
    Replies: 14
    Last Post: April 16th, 2009, 01:36 PM