package sprzedaz.nieobiektowo;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class CzytajPlik {
    public static void main(String[] args) {

        try (Scanner scanner = new Scanner(new File("sprzedaz.csv"))) {
        	while(scanner.hasNextLine()) {
        		String linia = scanner.nextLine();
        		String[] t = linia.split(",");
        		System.out.println("data: " + t[0] + ", miasto: " + t[1] + ", cena: " + t[5]);
        	}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
    }
}
