not willing to start a long discussion about this but the original question was
Is there a way to create a .txt file (>1GB) with Data which fills the whole file??
renaming a large file as .txt seems to fit the bill very simply. I don't see the issue with that.
of course you can do more complicated stuff with the command line and ensure proper distribution of the randomness of the data in the file etc... but that was not the ask. over engineered answer?
PS: OP has also clarified the real intent "my goal is to find bit flips", may be that's more interesting
some reading for OP Soft error - Wikipedia