The you can access any variable using the getProperty method. As for the CSV file, if all rows have the same number of values, you can read each line into an array using String.
Then access a "column" by walking the 2-d array. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Ask Question. Asked 11 years, 11 months ago. Active 2 years, 6 months ago. Viewed 22k times. I know how to do it in php and it is very easy but I am not java expert : My second question is about following file read. I have a file that has rows and colums it can be CSV, for example one,two,three four,five,six seven,eight,nine I want to read it that it return whole column for example one four seven same for others.
EDITED: Is it possible to write all variable name and its value and when I read file it automatically declare those variable and assign values? You should ask your two questions as two questions posted separately : — Tim Bender. Thanks, I will keep in mind.
But I thought both questions are inter related so I can ask at the same time — user Add a comment. Active Oldest Votes. BalusC 1. Using delimiter when reading a file Ask Question. Asked 9 years ago. Active 3 years, 2 months ago. Viewed 88k times. Amadeus,Drama, Mins. Bernhard Barker Robert Spratlin Robert Spratlin 3 3 gold badges 4 4 silver badges 8 8 bronze badges. Add a comment.
Active Oldest Votes. Use read. Community Bot 1 1 1 silver badge. Aniket Inge Aniket Inge Use BufferedReader to Read and process lines from console. Tab filter: Convert tab to space characters. List of lines in a file with BufferedReader. Use BufferedReader to read line by line. Using BufferedReader to read input number from user.
Read lines of text from a file with the BufferedReader class. Read from a file using a BufferedReader. Read content of a file. IOException; import java. Using split method to split delimited data Another way to read delimited file in Java is to read file line by line, you can use BufferedReader to read the file and then split delimited data using split method. BufferedReader; import java. FileReader; import java. Multiple Catch Blocks in Java. Leave a Reply Cancel reply Your email address will not be published.
0コメント