Question: Hello, I want to read a file, file.txt that contains word pairs like this... 

```
mot;word 
oui;yes
utiliser;use
comment;how

```

After reading this file.txt , I want to split this text and put the French words in an ArrayList and the English words in an another ArrayList.

Thanks in advance...

Answer: 
This looks like CSV file. Consider using CSV reader library.

Use [String#split](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29) function from JDK and read file line by line with [Scanner](http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html#Scanner(java.io.File)):

```
Scanner scanner = new Scanner(file);
while (scanner.hasNextLine()) {
  String line = scanner.nextLine();
  // process the line using String#split function
}

```

In `while` loop add splited data to `ArrayList`.

All information are already on stackoverflow.

* [Read String line by line in Java](https://stackoverflow.com/questions/1096621/how-to-read-a-string-line-per-line)
* [How to split a comma separated String while ignoring escaped commas?](https://stackoverflow.com/questions/820172/how-to-split-a-comma-separated-string-while-ignoring-escaped-commas)
* [Reading File by line instead of word by word](https://stackoverflow.com/questions/20318872/reading-file-by-line-instead-of-word-by-word/20318898#20318898)
* [Read line using Java New I/O](https://stackoverflow.com/questions/8035981/read-line-using-java-new-i-o)
* [CSV API for Java](https://stackoverflow.com/questions/101100/csv-api-for-java)
```
mot;word 
oui;yes
utiliser;use
comment;how

```

It appears that the structure of each line is 

```
frenchWord;englishWord

```

So you can read each line of your file using a [`Scanner`](http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html) (using the constructor [`Scanner(File source)`](http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html#Scanner%28java.io.File%29)) and the [`nextLine()`](http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html#nextLine%28%29) method, and [`split`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split%28java.lang.String%29) each line by `";"`.

The first element in the array will be the french word and the second one the english word.

Add those element in two separate [`List`](http://docs.oracle.com/javase/7/docs/api/java/util/List.html) ([`ArrayList`](http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html) per example), one containing all the french words, and the other one the english words.