Column format in Java

Posted in the Java Forum

fever104

United States

#1 Apr 3, 2006
Hi all,

I have a java question as follow:

A file is formated like this:

"age","phone number"
"Jane","New York","Jan",38, 2221234567
"Tom","New York","Feb",45, 2221234568
"David","New York","Mar", "Actual",24,22212345 69

Number of columns on the first row could be from 0 to any numbers, n.

How can I convert it to the following format in Java:

"Jane","New York","Jan", "age",38
"Jane","New York","Jan", "phone number",2221234567
"Tom","New York","Feb", "age",45
"Tom","New York","Feb", "phone number",2221234568
"David","New York","Mar", "age",24
"David","New York","Mar", "phone number",2221234569

Thanks in advance! Really appreciate your helps!!
prabhu

Chennai, India

#2 Mar 21, 2007
i need the age format as age = "038" for age = 38, and for age = "100" for age = 100.

Tell me when this thread is updated:

Subscribe Now Add to my Tracker

Add your comments below

Characters left: 4000

Please note by submitting this form you acknowledge that you have read the Terms of Service and the comment you are posting is in compliance with such terms. Be polite. Inappropriate posts may be removed by the moderator. Send us your feedback.

Java Discussions

Title Updated Last By Comments
Java 8u20 not removing earlier version... (Aug '14) Aug '14 prabha 1
News Free Java book to download: Beginning J2EE 1.4,... (Sep '07) Jul '14 suvankar 52
News Java Architect (Jul '14) Jul '14 Prasad 1
Contest 100 000 (Jun '14) Jun '14 kermekx 1
News Oracle Patches 51 For Java (Oct '13) Oct '13 java nese 1
Big Books Collections (Jun '10) Oct '13 karmina_goal 13
News Google Has Created A Programming Language That ... (Sep '13) Sep '13 commentard 2
More from around the web