I have a data with multiple values summarized in one column like (much more rows):
"(-99.0, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0)"
"(0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563, 0.43963563)"
"(0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014, 0.20000014)"
Now my goal is to get rid of the '"'
, '('
and ')'
and, which is the more important part, to split each row into 12 columns to finally get something like this:
1 2 3 4 5 6 7 8 9 10 11 12
-99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99
0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563 0.43963563
0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014 0.20000014
All I've got so far is some code to split my rows into separate values and to get rid of the ','
:
my_file = open("expand_single_column_alternate.dat","r")
content = my_file.read()
liste = content.split(",")