 <p>What do you mean by well formatted ? Do you need to send those data to a web service ? a database ?</p> <ol> <li>Do you know Maven or Gradle ? they would take care of the dependencies for you.</li> <li>No, once you code is packaged it will come with the dependencies it needs.</li> <li>If the data is that simple "String, Integer" and if the first String is unique I would go for a Map</li> </ol> <p>Edit:</p> <p>Simple example (read / write) with an HashMap :</p> <pre><code>import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.util.regex.Pattern; public class MapScanner { public static void main(String[] args) throws IOException { //Reading entries Scanner scanner = new Scanner(new File("data")); scanner.useDelimiter(Pattern.compile(",(\n)?")); final Map&lt;String, Integer&gt; entries = new HashMap&lt;&gt;(); while(scanner.hasNext()){ final String entry = scanner.next(); final String[] entrySplited = entry.split(":"); entries.put(entrySplited[0].trim(), new Integer(entrySplited[1].trim())); } for(String key : entries.keySet()){ System.out.println(key + " : " + entries.get(key)); } scanner.close(); //Adding a new entry in memory entries.put("pizza", new Integer(5)); //Saving all entries in the data file try(BufferedWriter bw = new BufferedWriter(new FileWriter("data"))){ for(String key : entries.keySet()){ bw.write(key + " : " + entries.get(key) + ","); bw.flush(); bw.newLine(); } } } } </code></pre> <p>It prints :</p> <pre><code>play : 20 sleep : 20 money : 50 food : 100 </code></pre> <p>And the file after is equal to :</p> <pre><code>play : 20, sleep : 20, pizza : 5, money : 50, food : 100, </code></pre>