Used the below command to roll all the lines into a single line
sed -i -e :a -e 'N;s/\n//;ta' input_file.txt
Then converted the ~ to a new line
sed -i 's/~/~\n/g' input_file.txt
This approach is working, but I am concerned about the record size after the first step - if my initial filw size is huge, then would I run into a probelm if I roll up all the lines into a single line?