Reputation: 877
Below is my sample data.MY environment is centos and I have run this command to make all into a single space sed 's/ */\ /g' but unfortunately the spaces are still not uniform. Any solution?
308589422 3.10882 101.54966 23 0 215 0.9 2011-08-01 00:00:00 1 00402020F028 00 000 0 00 109.6 13033 4D \N \N \N \N \N \N
308590571 5.00517 102.22741 20 0 340 0 2011-08-01 00:00:00 1 00000000 27.3 012 0 04.0 154856 BB1012 \N \N \N 01 0100 0
308596673 2.94121 101.76445 29 0 62 0 2011-08-01 00:00:00 1 00000000 25.4 000 0 04.1 56870.5 AB0569 \N \N \N 02 0000 F
308596708 3.99147 101.05772 15 0 105 0 2011-08-01 00:00:00 1 00000000 12.6 01B 0 04.1 42562.9 AB0829 \N \N \N 02 0000 F
308589424 5.4142 100.55539 26 0 126 1 2011-08-01 00:00:01 1 01000028F820 57 3FF 0 F5 1082.31 13276 75 \N \N \N \N \N \N
308589482 4.95754 102.07095 3 96 235 0 2011-08-01 00:00:01 1 00000000 27.0 000 0 04.1 10278.9 BB1788 \N \N \N 01 0100 F
Upvotes: 0
Views: 81
Reputation: 5605
i would recommend sed 's/\s+/ /g' (\s+ matching any repeatable whitespace , not only space char)
Upvotes: 1