I am trying to remove the file header and trailer and save the file. To achieve this, I am getting the first and last line of the file. I used tokenizer to get each line index and stringToFile to write new file content (without the header and trailer.)
Now, the code is working if I am only working for few lines (not more than 10). But when I am using a large file, it is getting formatted and will create 1-2 lines instead of the original 1 line per details.
I also tried using a Java service to split string but still getting the same result when using a large file.
Can you suggest a better way to get the header and trailer without destroying the file format? Original file format should be one line each data.
I am not getting and error message.
Thank you so much.