I need help on STRUCTURES and on input file

I need help. I need help on reading input file using .READ and normal streams. I also need help on sorting input file and passing data to the structure rec and output it without showing any null characters.....

>here's my confusing code...
That's an understatement. Not only did you neglect to use code tags, which killed any formatting your code may have had, the only comments you use are utterly useless. Perhaps instead of just saying "here's my confusing code", you could give us the code, tell us what you want it to do, tell us what is isn't doing that you want it to do, and provide an example input file along with the expected output. If you fail to do this, I'll be forced to treat you like an idiot and link you here.