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: 
```
public static void main(String[] args) {
    List<String> list = new ArrayList<String>(); 
    List<String> frenchList = new ArrayList<String>();
    List<String> englishList = new ArrayList<String>();
    File file = new File("C:/dico.txt");
    if(file.exists()){
        try { 
            list = Files.readAllLines(file.toPath(),Charset.defaultCharset());
        } catch (IOException ex) {
            ex.printStackTrace();
        }
      if(list.isEmpty())
          return;
    }
    for(String line : list){
        String [] res = line.split(";");
        frenchList.add(res[0]);
        englishList.add(res[1]);
    }
}

```

With this code you have de french word in the list "frenchlist" and the english words in the list "englishlist"
```
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.