I have a .csv file that looks like this:
1 [AS?] [NULL] x.x.x.x 1.5ms
2 [AS?] [NULL] x.x.x.x 2.7ms
4 [AS?] [NULL] x.x.x.x 31.6ms
6 [AS?] [NULL] x.x.x.x 43.5ms
7 [6805] [TEDE-INFRA] x.x.x.x 52.8ms
8 [6805] [TEDE-INFRA] x.x.x.x 49.2ms
9 [12638] [TEDE-INFRA] x.x.x.x 45.9ms
10 [15169] [GOOGLE] x.x.x.x 65.4ms
11 [15169] [GOOGLE] x.x.x.x 67.3ms
12 [15169] [GOOGLE] x.x.x.x 30.9ms
I need to remove the space in the first 7 lines and in the last one (between [GOOGLE] and x.x.x.x, because that ruins the processing in pandas. I tried to convert the sep in comma, but error persist like this:
,1,,[AS?],[NULL],x.x.x.x,1.5ms
,2,,[AS?],[NULL],x.x.x.x,2.7ms
,4,,[AS?],[NULL],x.x.x.x,31.6ms
,6,,[AS?],[NULL],x.x.x.x,43.5ms
,7,,[6805],[TEDE-INFRA],x.x.x.x,52.8ms
,8,,[6805],[TEDE-INFRA],x.x.x.x,49.2ms
,9,,[12638],[TEDE-INFRA],x.x.x.x,45.9ms
10,,[15169],[GOOGLE],x.x.x.x,65.4ms
11,,[15169],[GOOGLE],x.x.x.x,67.3ms
12,,[15169],[GOOGLE],,x.x.x.x,30.9ms
What I expect is something like this
1,,[AS?],[NULL],x.x.x.x,1.5ms
2,,[AS?],[NULL],x.x.x.x,2.7ms
4,,[AS?],[NULL],x.x.x.x,31.6ms
6,,[AS?],[NULL],x.x.x.x,43.5ms
7,,[6805],[TEDE-INFRA],x.x.x.x,52.8ms
8,,[6805],[TEDE-INFRA],x.x.x.x,49.2ms
9,,[12638],[TEDE-INFRA],x.x.x.x,45.9ms
10,,[15169],[GOOGLE],x.x.x.x,65.4ms
11,,[15169],[GOOGLE],x.x.x.x,67.3ms
12,,[15169],[GOOGLE],x.x.x.x,30.9ms
With the frist lines and the last line without unnecesary spaces/coma. Is possible do it? How I can do?