Monthly Archives: Şubat 2018

Dosya okuma word by word yazma

public static void main(String args[]) throws Exception{    int tokencount;    FileReader fr=new FileReader(“input.txt”);    BufferedReader br=new BufferedReader(fr);    String s;    String line;    String words[]=new String[500]; //500 satır sayısı bunu hesaplayıp da gönderenilirsiniz    while ((s=br.readLine())!=null){    line=s; int idx=0; StringTokenizer st= new StringTokenizer(line); tokencount= st.countTokens(); for (idx=0;idx<tokencount;idx++){   words[idx]=st.nextToken(); writer(words[idx]); } }    […]