Unless you are making very small byte-for-byte changes, you will almost certainly need to read from a source file and write to a destination file
This is not a method that is appropriate for a novice. You will probably need to know the formats inside out and understand how to indicate in the format that a record has a specific length etc.