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"
First, you have to create two array lists..

```
    ArrayList<String> english = new ArrayList<>();
    ArrayList<String> french = new ArrayList<>();

```

Then, open the file, read line by line, split it bye ";" and add the words to ArrayLists...

```
    try(BufferedReader in = new BufferedReader(new FileReader("file.txt"))){
      String line;
      while((line = in.readLine())!=null){
          String[] pair = line.split(";");
          french.add(pair[0]);
          english.add(pair[1]);
      }
    }

```