in reply to
I need to insert spaces and get the values for all the variables
Then you will need to plan out the steps to achieve this. I am guessing inserting spaces is not your true aim, but graphing or outputting a graphable format is.
# open the file
# Read a line at a time probably in a while loop
# split the line on appropriate markers and assign the results
# to a suitable data structure
# look at split and hash data structures.
# store the above result (print to a csv perhaps)
# or plot the graph points, continue to the next line
# close the file when done.
Pereant, qui ante nos nostra dixerunt!