get all sections from the first page and write to output file