so I have a program that reads from a file that looks like this:
1 2 3
hello-world .txt
hello, world! this is the content
$stopf
the first part ('hello-world') is the title of the file that my program is going to create. the second part ('.txt') is the extension of the file. the final part ('$stopf') is the command to stop writing to the file. everything that is between the second and final part is the content of the file.
now what I wanted to do is add comments, so it would look like this:
1 2 3 4 5
hello-world .txt #this is valid and is a comment too
hello, world! this is the content
#this is a comment
this is not :)
$stopf
the comments, as you would expect do not appear in the file but there is a ghost line, so the output would be:
1 2 3 4
hello, world! this is the content
this is not :)
this is problem 1, and problem 2 is how can I fix this bug:
1 2 3
hello-world .txt
hello, world! #this still outputs in the file
$stopf
hello-world .txt #this is valid and is a comment too
hello, world! this is the content
#this is a comment
this is not :)
$stop
another-file .txt
more content # another comment?
# comment (what to do with the spaces?)
last line
$stopf