file reading help

# user 1
1011 user1
#prints
1 D_1 10 1
3 D_2 3 2
##
# user 2
1012 user2
#prints
5 D_4 5 3
4 D_5 2 2
##
# user 3
1013 user3
#prints
2 D_11 4 4
6 D_21 2 1
##

how to read from file?
# in the file is used to comment anything for sake of ease. When a compile reads the text file it shall
ignore all the lines starting with # sign
and how to ignore white spaces??
Topic archived. No new replies allowed.