Hello,
Voici une version sed:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 $ cat sup.txt 2013-06-18 08:51:59.654 7140.215 any 37492 2.2 M(52.5) 346.4 M(50.1) 76.3 G(19.2) 48515 85.5 M 220 2013-06-18 08:51:59.673 7138.118 any 5511 338118( 8.0) 48.2 M( 7.0) 54.3 G(13.7) 6753 60.8 M 1125 2013-06-18 08:51:59.659 7140.131 any 15169 183338( 4.3) 31.5 M( 4.6) 39.0 G( 9.8) 4414 43.7 M 1237 2013-06-18 08:51:59.655 7136.075 any 20940 73633( 1.7) 24.5 M( 3.5) 33.4 G( 8.4) 3431 37.4 M 1362 2013-06-18 08:52:00.664 7139.196 any 16265 34131( 0.8) 11.9 M( 1.7) 15.4 G( 3.9) 1660 17.3 M 1302 2013-06-18 08:51:59.761 7140.108 any 32934 191621( 4.5) 21.4 M( 3.1) 14.7 G( 3.7) 2992 16.5 M 687 2013-06-18 08:52:06.706 7077.579 any 6762 28505( 0.7) 8.2 M( 1.2) 10.7 G( 2.7) 1155 12.1 M 1310 2013-06-18 08:51:59.714 7140.107 any 12322 84015( 2.0) 15.0 M( 2.2) 9.9 G( 2.5) 2096 11.1 M 660 2013-06-18 08:51:59.772 7139.997 any 22822 26327( 0.6) 7.0 M( 1.0) 9.3 G( 2.3) 983 10.4 M 1316 2013-06-18 08:51:59.668 7079.582 any 15133 34542( 0.8) 6.1 M( 0.9) 8.0 G( 2.0) 867 9.0 M 1299 2013-06-18 08:52:00.662 7139.158 any 47541 9507( 0.2) 3.5 M( 0.5) 4.8 G( 1.2) 485 5.4 M 1390 $ sed 's/[0-9.:-]*[-:][0-9.]* *\|([^)]*)\| [[:alpha:]]\{2,\} //g;s/ \+\([0-9]\)/:\1/g;s/^\([^:]*:\)\([^:]*:\)\([^:]*:\)\([^:]*:\)\([^:]*:\)\([^:]*:\)\([^:]*:\)\([^:]*\)$/\2\5\4\3\6\7\8/' sup.txt 37492:76.3 G:346.4 M:2.2 M:48515:85.5 M:220 5511:54.3 G:48.2 M:338118:6753:60.8 M:1125 15169:39.0 G:31.5 M:183338:4414:43.7 M:1237 20940:33.4 G:24.5 M:73633:3431:37.4 M:1362 16265:15.4 G:11.9 M:34131:1660:17.3 M:1302 32934:14.7 G:21.4 M:191621:2992:16.5 M:687 6762:10.7 G:8.2 M:28505:1155:12.1 M:1310 12322:9.9 G:15.0 M:84015:2096:11.1 M:660 22822:9.3 G:7.0 M:26327:983:10.4 M:1316 15133:8.0 G:6.1 M:34542:867:9.0 M:1299 47541:4.8 G:3.5 M:9507:485:5.4 M:1390
Partager