parse grid from textfile into two dimensional array