title: Writing from hashmap to a txt file
body: <p>I have a hashMap of Integer,String  (K,V) and want to write only the string values to a file (not the key Integer) and I want to write only some 1st n entries (no specific order) to the file and not the entire map.
  I have tried looking around a lot but could not find a way to write 1st n entries to file.(There are examples where I can convert the value to array of Strings and then do it] but then it does not provide the correct format in which I want to write the file) </p>