I have a large file file.dat, a database dump in a CSV format that looks like this:
file_id,line_id,st_x,st_y,value1,value2,...value100
111111,1,22.22222,33.33333,0.1234567,0.246890,0.369258,...
.....
It has several million lines.
Suddenly I realized that I want to change the names of the columns: change st_x to lon and st_y to lat.
Just copying the file on my machine takes some time T_copy.
Editing the file with
sed -i 's/st_y/lat/' file.dat
takes T_sed where T_sed ~ 1.7 T_copy.
Is there a faster method? I would not mind if the replacement string must have the same number of characters as the target string.
Note: I am sure this question has been asked before, just do not see how to find it.
برچسب:
نویسنده: استخدام کار