Newsgroup: it.comp.os.linux.iniziare
Titolo: Re: Riformattare un file di testo

 ricetta gi� pronta con bash|sed|awk che potrei usare � il benvenuto.
la trasformazione che hai illustrato no � ben interpetabile, descrivia
meglio


Scusa, faccio un esempio con dati reali:
Originale:
	Class	c1	 c2	  c3       ...
YDL179w	1	-0.75808 -0.90319 -0.98935 ...
YLR079w	2	-0.48845 -0.70828 -0.47688 ...
...     ...     ...      ...      ...
Modificato:
1	c1:-0.75808 c2:-0.90319 c3:-0.98935 ... 
2	c1:-0.48845 c2:-0.70828 c3:-0.47688 ...
...     ...         ....        ...
-- 
      Daniele Giglio      Dona i tuoi cicli di clock alla ricerca!
 
http://boinc.berkeley.edu/
                          --------------------
   Se uno uccide un uomo e' un assassino; ne uccide un milione, e' un
   conquistatore; li uccide tutti, e' un dio.
   		-- Jean Rostand, "Pensieri di un biologo"

 ...     ...         ....        ...
Assumo che la riga "Class   c1  c2 etc." sia presente nel file originale, e
che non ti importa conservare i vari YDL179w etc.
awk '
NR==1{
  for(i=2;i<=NF;i++){
    h[i+1]=$i
  }
  next
}
{
  s=$2
  for(i=3;i<=NF;i++){
    s=s OFS h[i]":"$i
  }
  print s
}' file.txt
se vuoi i campi in output separati da tab, aggiungi un blocco BEGIN in cui
imposti OFS="\t".

 }' file.txt
Funziona solo parzialmente. Quando deve scrivere la i_esima riga le antepone
le i-1 righe precedenti:
riga1
riga1riga2
riga1riga2riga3
ecc.
Io ho messo insieme il seguente script PERL (sicuramente migliorabile)
--8<---------------cut here---------------start------------->8---
#!/usr/bin/perl
use warnings;
use strict;
while (<STDIN>) {
    chomp;
    if ($i > 1) {
	my $j=0;
	foreach my $item (split(/\s+/, $_)) {
	    if ($j == 0) { }
	    elsif ($j == 1) { print "$item "; }
	    else  { printf "%i:%s ", $j-1,$item; } # dato che le etichette
                                                   # sono numeri progressivi 
                                                   # ho risolto con la
                                                   # variabile $i
	    ++$j;
	}
	print "\n";
    }
    ++$i;
}
--8<---------------cut here---------------end--------------->8---
l'I/O avviene su stdin e stdout
-- 
      Daniele Giglio      Dona i tuoi cicli di clock alla ricerca!
 
http://boinc.berkeley.edu/
                          --------------------
               "Vai a donne?  Non dimenticare la frusta."
               		-- Nietzsche, "Cosi' parlo' Zaratustra"

 riga1riga2riga3
Allora l'input non e' quello che hai mostrato prima, perche' a me con quello
funzionava. Posta qualche riga del VERO input, e un esempio dell'output che
vorresti ottenere da tale input.

 vorresti ottenere da tale input.
Agli ordini!
INPUT:
,----[ norm_cellcycle_384_17.txt ]
| 	Main Gp	c1	c2	c3	c4	c5	c6	c7	c8	c9	c10	c11	c12	c13	c14	c15	c16	c17
| YLR079w	1	-0.48845	-0.70828	-0.47688	-0.65814	-0.45374	-0.47302	-0.71214	-1.02839	0.24048	3.11376	1.28952	0.44874	0.04379	-0.31104	-0.30332	-0.34575	0.82285	
| YER111c	1	-0.42218	0.23887	1.84427	-0.02083	-0.61105	-0.65827	-0.79992	-0.39857	-0.09166	2.03314	1.58457	0.68744	0.14443	-0.72910	-1.46097	-0.82353	-0.51662	
| YBR200w	1	0.09824	0.55258	-0.89641	-1.19111	-1.11744	-0.76133	0.09824	2.16120	1.46126	1.03148	0.67537	-0.33155	-0.60170	-1.39987	-0.42978	-0.15963	0.81045	
| YJL194w	1	-1.29859	1.71422	-0.52745	-1.11926	-0.63505	-0.02532	-0.36605	-0.76059	1.44522	2.05496	-0.22259	0.20782	-0.36605	0.01055	-0.77852	-0.49159	1.15829	
[...]
| YGR109c	2	-0.37784	0.55571	2.98645	0.43241	-0.75361	-0.69489	-0.55398	-0.88278	-0.78884	0.90212	1.20156	0.34434	-0.26628	-0.24280	-0.56572	-0.74186	-0.55398	
| YPR120c	2	-0.52357	0.09400	2.78305	0.54817	-0.25494	-0.38510	-0.78666	-0.52080	-0.81990	1.26267	1.58945	-0.29925	-0.28818	-0.26048	-0.67035	-0.79497	-0.67312	
| YDL127w	2	-0.93147	1.26476	1.94147	-0.27322	-0.49469	-0.42702	-0.90687	-1.07297	-0.40856	0.76031	2.18140	0.64342	-0.12557	-0.17479	-0.77768	-0.62388	-0.57466	
| YMR199w	2	-1.85329	0.25511	0.95869	0.86692	0.14451	0.17981	-0.51672	-0.86027	-1.44385	0.50689	2.19643	1.06223	0.12333	0.32335	-0.39435	-0.75909	-0.78968	
| YJL187c	2	-1.08147	-0.51034	2.07335	1.61100	0.60473	-0.14318	-0.68712	-0.89109	-0.98628	0.15598	1.18946	1.08067	0.35996	-0.26557	-0.53753	-0.91829	-1.05427	
| YDL003w	2	-1.13183	0.04638	2.19693	0.90265	-0.19671	-0.53397	-0.77267	-0.93911	-1.08365	0.61577	1.76988	1.11946	0.08580	-0.14634	-0.47265	-0.81866	-0.64128	
| YMR076c	2	-1.10268	-0.40790	2.19009	1.40339	0.34636	-0.17540	-0.58362	-0.88100	-1.18378	0.84378	1.24389	0.98977	-0.23488	-0.16189	-0.48630	-0.84315	-0.95669	
[...]
| YDR113c	3	-1.10658	-0.61428	0.88500	1.28034	2.04117	1.07894	-0.59190	-0.86789	-1.17372	-1.00216	0.01974	0.88500	0.71344	0.43746	-0.18165	-0.80822	-0.99470	
| YNL126w	3	-0.33677	-0.25877	0.38082	1.16081	1.25441	1.80040	0.64601	-0.63317	-1.08556	-1.67835	-0.83596	-0.16517	1.12961	0.73961	-0.05598	-1.13236	-0.92956	
| YEL061c	3	-1.11905	-0.79778	0.51025	1.33638	1.70355	1.15280	0.39551	-0.26998	-1.18789	-1.50917	-0.79778	-0.13229	1.12985	0.99216	0.00540	-0.66009	-0.75188	
| YHR172w	3	-0.70615	0.12617	1.72678	1.79081	0.86245	1.34264	0.19019	-0.86622	-0.93024	-0.83420	-0.35402	-0.19396	0.70239	0.31824	-0.73817	-0.96225	-1.47445	
| YPR141c	3	-0.64054	-0.85859	0.85859	2.27596	1.55365	1.39011	0.16354	-0.50425	-0.92674	-1.00851	-0.62691	-0.42248	0.43611	0.23168	-0.13628	-0.94037	-0.84497	
| YLR045c	3	-1.64677	-1.61786	-0.16269	0.34806	2.11160	1.07082	0.61789	-0.25906	-0.76981	-1.32875	-0.27834	0.11678	0.84918	0.77208	0.71426	-0.11451	-0.42289	
| YGR140w	3	-0.88064	-0.62014	1.86223	1.20333	1.34124	1.41785	0.16135	-0.74273	-1.04919	-0.95725	-0.43626	0.05408	0.60572	0.65169	-0.58950	-0.74273	-1.27904	
| YBL063w	3	-1.11583	-1.37589	0.01620	0.70459	2.41793	0.91876	0.24566	-0.64160	-0.58041	-1.48297	-0.41214	0.70459	1.14822	0.45983	-0.13678	-0.24386	-0.62630	
| YDR488c	3	-1.32845	-0.31438	0.83673	1.63155	-0.42401	0.31599	-0.61586	-1.49290	-0.45142	-0.20475	0.67229	1.49451	1.38488	0.91895	-0.78030	-1.16401	-0.47882	
[...]
| YIL050w	4	-1.46188	-1.74081	-1.04350	-0.40198	1.46681	2.02465	0.65793	0.10008	0.10008	-1.07139	-0.82036	0.18376	0.35111	0.74161	0.51847	0.23955	0.15587	
| YIL106w	4	-1.36396	-1.03654	-1.18537	-1.06631	-0.45611	0.58568	1.56794	1.19587	1.98466	0.13920	-0.06916	-0.56029	-0.75377	-0.03940	1.10658	0.04990	-0.09893	
| YBL097w	4	-1.81637	-1.08263	-0.96034	-1.02148	1.66890	1.36318	1.42432	0.69058	-0.16545	-0.34889	-0.59347	-0.16545	0.26256	0.93516	0.44600	-0.83805	0.20142	
| YKL049c	4	-1.72573	-1.77645	0.40458	0.92194	1.72334	0.69876	0.01910	-0.35624	-0.97505	-0.85332	-0.43740	0.15097	0.62775	1.24656	0.97266	0.04953	-0.69101	
| YCL014w	4	-0.92310	-0.94508	-1.07696	-0.59342	0.35166	0.85717	1.78027	2.21985	0.85717	-1.16487	-0.74728	-0.74728	-0.21979	0.41760	0.26374	-0.50551	0.17583	
| YOR188w	4	-0.80905	0.04942	0.65219	0.90790	1.27321	2.25955	1.16362	0.41473	-0.79079	-0.90038	-0.99171	-0.06017	-0.09670	-0.22456	-0.31589	-1.10130	-1.43008	
| YJR076c	4	-1.00311	-1.37785	-0.43406	0.35242	1.07414	1.51827	0.72716	1.07877	-0.55435	-1.39635	-0.39243	-0.78567	-0.23050	1.54603	1.12040	-0.36467	-0.87820	
| YJL099w	4	0.29454	-1.59894	-1.09401	-0.18935	-0.31558	2.06179	1.89348	0.00000	0.14727	-0.29454	-1.36751	-0.65220	-0.21039	1.15713	0.48389	0.08415	-0.39973	
| YBR038w	4	-1.03506	-1.26889	-0.95155	-0.77617	-0.63420	-0.18324	1.77930	1.77095	1.81270	0.11741	-0.27510	-0.78452	-0.26675	-0.52563	0.61013	0.60178	0.00884	
| YJL092w	4	-1.27678	-1.10499	-0.08172	1.00877	1.65858	2.25611	0.55315	-0.11907	-0.70913	-0.71659	-0.71659	-0.23857	0.03032	1.01624	0.05272	-0.66431	-0.94814	
[...]
| YGR108w	5	-1.49391	-0.82181	-1.12649	-1.10857	-0.59777	0.64785	1.57087	1.09592	0.96150	-0.51712	-0.73219	-0.81284	-0.60673	0.48655	1.11384	1.09592	0.84500	
| YPR119w	5	-1.38564	-0.89396	-1.16215	-0.99081	-0.14154	0.52148	1.57188	2.05611	1.07275	-0.31289	-0.69282	-0.94611	-0.44698	-0.08195	0.64812	0.53638	0.64812	
| YAL040c	5	-0.21050	-0.36441	-0.92235	-0.92663	0.19352	-1.01855	0.41157	0.23628	-0.09293	3.45564	0.36026	-0.17202	-0.72568	-0.20622	0.16573	0.12084	-0.30456	
| YGL116w	5	-0.96489	-0.94733	-0.84196	-0.85952	-0.75415	-0.24484	1.26552	2.33682	1.59920	-0.06922	-0.31509	-0.70146	-0.61365	-0.56096	0.24691	0.47521	0.94940	
| YOL069w	5	-1.02006	-1.62852	-1.39190	-0.54682	-0.51301	1.07574	1.44757	1.65039	0.83911	-0.71583	-0.41160	-1.05386	0.39967	0.39967	0.60249	0.06164	0.80531	
| YGR092w	5	-1.29288	-1.07937	-1.04379	-1.20985	-0.65237	0.01186	1.17426	1.76732	1.82663	0.61678	0.01186	-0.15420	-0.65237	-0.48631	-0.35584	0.75912	0.75912	
| YBR138c	5	-0.85589	-1.15043	-1.39588	-1.05225	-0.68899	-0.09009	1.03897	2.00113	1.49060	-0.12937	-0.60063	-0.74790	-0.14900	-0.14900	0.68552	1.03897	0.75425	
| YOR058c	5	-0.35455	-0.10600	-1.47302	-0.47882	-0.64452	0.63965	1.88239	1.57170	1.38529	-0.54096	-0.85164	-1.61800	-0.35455	-0.37526	0.26682	0.22540	0.82606	
| YHR023w	5	-1.21582	-1.45476	-1.27907	-1.26501	-0.46384	0.46384	1.86941	1.49693	0.68873	0.34436	-0.23895	-0.55520	-0.70981	0.31625	0.47789	0.60439	0.92065	
[...]
`----
OUTPUT:
,----[ norm_cellcycle_384_17_svm ]
| 1 1:-0.48845 2:-0.70828 3:-0.47688 4:-0.65814 5:-0.45374 6:-0.47302 7:-0.71214 8:-1.02839 9:0.24048 10:3.11376 11:1.28952 12:0.44874 13:0.04379 14:-0.31104 15:-0.30332 16:-0.34575 17:0.82285 
| 1 1:-0.42218 2:0.23887 3:1.84427 4:-0.02083 5:-0.61105 6:-0.65827 7:-0.79992 8:-0.39857 9:-0.09166 10:2.03314 11:1.58457 12:0.68744 13:0.14443 14:-0.72910 15:-1.46097 16:-0.82353 17:-0.51662 
| 1 1:0.09824 2:0.55258 3:-0.89641 4:-1.19111 5:-1.11744 6:-0.76133 7:0.09824 8:2.16120 9:1.46126 10:1.03148 11:0.67537 12:-0.33155 13:-0.60170 14:-1.39987 15:-0.42978 16:-0.15963 17:0.81045 
| 1 1:-1.29859 2:1.71422 3:-0.52745 4:-1.11926 5:-0.63505 6:-0.02532 7:-0.36605 8:-0.76059 9:1.44522 10:2.05496 11:-0.22259 12:0.20782 13:-0.36605 14:0.01055 15:-0.77852 16:-0.49159 17:1.15829 
[...]
| 2 1:-0.37784 2:0.55571 3:2.98645 4:0.43241 5:-0.75361 6:-0.69489 7:-0.55398 8:-0.88278 9:-0.78884 10:0.90212 11:1.20156 12:0.34434 13:-0.26628 14:-0.24280 15:-0.56572 16:-0.74186 17:-0.55398 
| 2 1:-0.52357 2:0.09400 3:2.78305 4:0.54817 5:-0.25494 6:-0.38510 7:-0.78666 8:-0.52080 9:-0.81990 10:1.26267 11:1.58945 12:-0.29925 13:-0.28818 14:-0.26048 15:-0.67035 16:-0.79497 17:-0.67312 
| 2 1:-0.93147 2:1.26476 3:1.94147 4:-0.27322 5:-0.49469 6:-0.42702 7:-0.90687 8:-1.07297 9:-0.40856 10:0.76031 11:2.18140 12:0.64342 13:-0.12557 14:-0.17479 15:-0.77768 16:-0.62388 17:-0.57466 
| 2 1:-1.85329 2:0.25511 3:0.95869 4:0.86692 5:0.14451 6:0.17981 7:-0.51672 8:-0.86027 9:-1.44385 10:0.50689 11:2.19643 12:1.06223 13:0.12333 14:0.32335 15:-0.39435 16:-0.75909 17:-0.78968 
| 2 1:-1.08147 2:-0.51034 3:2.07335 4:1.61100 5:0.60473 6:-0.14318 7:-0.68712 8:-0.89109 9:-0.98628 10:0.15598 11:1.18946 12:1.08067 13:0.35996 14:-0.26557 15:-0.53753 16:-0.91829 17:-1.05427 
| 2 1:-1.13183 2:0.04638 3:2.19693 4:0.90265 5:-0.19671 6:-0.53397 7:-0.77267 8:-0.93911 9:-1.08365 10:0.61577 11:1.76988 12:1.11946 13:0.08580 14:-0.14634 15:-0.47265 16:-0.81866 17:-0.64128 
| 2 1:-1.10268 2:-0.40790 3:2.19009 4:1.40339 5:0.34636 6:-0.17540 7:-0.58362 8:-0.88100 9:-1.18378 10:0.84378 11:1.24389 12:0.98977 13:-0.23488 14:-0.16189 15:-0.48630 16:-0.84315 17:-0.95669 
[...]
| 3 1:-1.10658 2:-0.61428 3:0.88500 4:1.28034 5:2.04117 6:1.07894 7:-0.59190 8:-0.86789 9:-1.17372 10:-1.00216 11:0.01974 12:0.88500 13:0.71344 14:0.43746 15:-0.18165 16:-0.80822 17:-0.99470 
| 3 1:-0.33677 2:-0.25877 3:0.38082 4:1.16081 5:1.25441 6:1.80040 7:0.64601 8:-0.63317 9:-1.08556 10:-1.67835 11:-0.83596 12:-0.16517 13:1.12961 14:0.73961 15:-0.05598 16:-1.13236 17:-0.92956 
| 3 1:-1.11905 2:-0.79778 3:0.51025 4:1.33638 5:1.70355 6:1.15280 7:0.39551 8:-0.26998 9:-1.18789 10:-1.50917 11:-0.79778 12:-0.13229 13:1.12985 14:0.99216 15:0.00540 16:-0.66009 17:-0.75188 
| 3 1:-0.70615 2:0.12617 3:1.72678 4:1.79081 5:0.86245 6:1.34264 7:0.19019 8:-0.86622 9:-0.93024 10:-0.83420 11:-0.35402 12:-0.19396 13:0.70239 14:0.31824 15:-0.73817 16:-0.96225 17:-1.47445 
| 3 1:-0.64054 2:-0.85859 3:0.85859 4:2.27596 5:1.55365 6:1.39011 7:0.16354 8:-0.50425 9:-0.92674 10:-1.00851 11:-0.62691 12:-0.42248 13:0.43611 14:0.23168 15:-0.13628 16:-0.94037 17:-0.84497 
| 3 1:-1.64677 2:-1.61786 3:-0.16269 4:0.34806 5:2.11160 6:1.07082 7:0.61789 8:-0.25906 9:-0.76981 10:-1.32875 11:-0.27834 12:0.11678 13:0.84918 14:0.77208 15:0.71426 16:-0.11451 17:-0.42289 
| 3 1:-0.88064 2:-0.62014 3:1.86223 4:1.20333 5:1.34124 6:1.41785 7:0.16135 8:-0.74273 9:-1.04919 10:-0.95725 11:-0.43626 12:0.05408 13:0.60572 14:0.65169 15:-0.58950 16:-0.74273 17:-1.27904 
| 3 1:-1.11583 2:-1.37589 3:0.01620 4:0.70459 5:2.41793 6:0.91876 7:0.24566 8:-0.64160 9:-0.58041 10:-1.48297 11:-0.41214 12:0.70459 13:1.14822 14:0.45983 15:-0.13678 16:-0.24386 17:-0.62630 
| 3 1:-1.32845 2:-0.31438 3:0.83673 4:1.63155 5:-0.42401 6:0.31599 7:-0.61586 8:-1.49290 9:-0.45142 10:-0.20475 11:0.67229 12:1.49451 13:1.38488 14:0.91895 15:-0.78030 16:-1.16401 17:-0.47882 
[...]
| 4 1:-1.46188 2:-1.74081 3:-1.04350 4:-0.40198 5:1.46681 6:2.02465 7:0.65793 8:0.10008 9:0.10008 10:-1.07139 11:-0.82036 12:0.18376 13:0.35111 14:0.74161 15:0.51847 16:0.23955 17:0.15587 
| 4 1:-1.36396 2:-1.03654 3:-1.18537 4:-1.06631 5:-0.45611 6:0.58568 7:1.56794 8:1.19587 9:1.98466 10:0.13920 11:-0.06916 12:-0.56029 13:-0.75377 14:-0.03940 15:1.10658 16:0.04990 17:-0.09893 
| 4 1:-1.81637 2:-1.08263 3:-0.96034 4:-1.02148 5:1.66890 6:1.36318 7:1.42432 8:0.69058 9:-0.16545 10:-0.34889 11:-0.59347 12:-0.16545 13:0.26256 14:0.93516 15:0.44600 16:-0.83805 17:0.20142 
| 4 1:-1.72573 2:-1.77645 3:0.40458 4:0.92194 5:1.72334 6:0.69876 7:0.01910 8:-0.35624 9:-0.97505 10:-0.85332 11:-0.43740 12:0.15097 13:0.62775 14:1.24656 15:0.97266 16:0.04953 17:-0.69101 
| 4 1:-0.92310 2:-0.94508 3:-1.07696 4:-0.59342 5:0.35166 6:0.85717 7:1.78027 8:2.21985 9:0.85717 10:-1.16487 11:-0.74728 12:-0.74728 13:-0.21979 14:0.41760 15:0.26374 16:-0.50551 17:0.17583 
| 4 1:-0.80905 2:0.04942 3:0.65219 4:0.90790 5:1.27321 6:2.25955 7:1.16362 8:0.41473 9:-0.79079 10:-0.90038 11:-0.99171 12:-0.06017 13:-0.09670 14:-0.22456 15:-0.31589 16:-1.10130 17:-1.43008 
| 4 1:-1.00311 2:-1.37785 3:-0.43406 4:0.35242 5:1.07414 6:1.51827 7:0.72716 8:1.07877 9:-0.55435 10:-1.39635 11:-0.39243 12:-0.78567 13:-0.23050 14:1.54603 15:1.12040 16:-0.36467 17:-0.87820 
| 4 1:0.29454 2:-1.59894 3:-1.09401 4:-0.18935 5:-0.31558 6:2.06179 7:1.89348 8:0.00000 9:0.14727 10:-0.29454 11:-1.36751 12:-0.65220 13:-0.21039 14:1.15713 15:0.48389 16:0.08415 17:-0.39973 
| 4 1:-1.03506 2:-1.26889 3:-0.95155 4:-0.77617 5:-0.63420 6:-0.18324 7:1.77930 8:1.77095 9:1.81270 10:0.11741 11:-0.27510 12:-0.78452 13:-0.26675 14:-0.52563 15:0.61013 16:0.60178 17:0.00884 
| 4 1:-1.27678 2:-1.10499 3:-0.08172 4:1.00877 5:1.65858 6:2.25611 7:0.55315 8:-0.11907 9:-0.70913 10:-0.71659 11:-0.71659 12:-0.23857 13:0.03032 14:1.01624 15:0.05272 16:-0.66431 17:-0.94814 
[...]
| 5 1:-1.49391 2:-0.82181 3:-1.12649 4:-1.10857 5:-0.59777 6:0.64785 7:1.57087 8:1.09592 9:0.96150 10:-0.51712 11:-0.73219 12:-0.81284 13:-0.60673 14:0.48655 15:1.11384 16:1.09592 17:0.84500 
| 5 1:-1.38564 2:-0.89396 3:-1.16215 4:-0.99081 5:-0.14154 6:0.52148 7:1.57188 8:2.05611 9:1.07275 10:-0.31289 11:-0.69282 12:-0.94611 13:-0.44698 14:-0.08195 15:0.64812 16:0.53638 17:0.64812 
| 5 1:-0.21050 2:-0.36441 3:-0.92235 4:-0.92663 5:0.19352 6:-1.01855 7:0.41157 8:0.23628 9:-0.09293 10:3.45564 11:0.36026 12:-0.17202 13:-0.72568 14:-0.20622 15:0.16573 16:0.12084 17:-0.30456 
| 5 1:-0.96489 2:-0.94733 3:-0.84196 4:-0.85952 5:-0.75415 6:-0.24484 7:1.26552 8:2.33682 9:1.59920 10:-0.06922 11:-0.31509 12:-0.70146 13:-0.61365 14:-0.56096 15:0.24691 16:0.47521 17:0.94940 
| 5 1:-1.02006 2:-1.62852 3:-1.39190 4:-0.54682 5:-0.51301 6:1.07574 7:1.44757 8:1.65039 9:0.83911 10:-0.71583 11:-0.41160 12:-1.05386 13:0.39967 14:0.39967 15:0.60249 16:0.06164 17:0.80531 
| 5 1:-1.29288 2:-1.07937 3:-1.04379 4:-1.20985 5:-0.65237 6:0.01186 7:1.17426 8:1.76732 9:1.82663 10:0.61678 11:0.01186 12:-0.15420 13:-0.65237 14:-0.48631 15:-0.35584 16:0.75912 17:0.75912 
| 5 1:-0.85589 2:-1.15043 3:-1.39588 4:-1.05225 5:-0.68899 6:-0.09009 7:1.03897 8:2.00113 9:1.49060 10:-0.12937 11:-0.60063 12:-0.74790 13:-0.14900 14:-0.14900 15:0.68552 16:1.03897 17:0.75425 
| 5 1:-0.35455 2:-0.10600 3:-1.47302 4:-0.47882 5:-0.64452 6:0.63965 7:1.88239 8:1.57170 9:1.38529 10:-0.54096 11:-0.85164 12:-1.61800 13:-0.35455 14:-0.37526 15:0.26682 16:0.22540 17:0.82606 
| 5 1:-1.21582 2:-1.45476 3:-1.27907 4:-1.26501 5:-0.46384 6:0.46384 7:1.86941 8:1.49693 9:0.68873 10:0.34436 11:-0.23895 12:-0.55520 13:-0.70981 14:0.31625 15:0.47789 16:0.60439 17:0.92065 
[...]
`----
-- 
      Daniele Giglio      Dona i tuoi cicli di clock alla ricerca!
 
http://boinc.berkeley.edu/
                          --------------------
       Esiste il mondo ideale della menzogna, dove tutto e' vero.
       		-- Stanislaw J. Lec, "Pensieri spettinati"

 INPUT:
Se quello e' l'esatto input (a parte le parti con [...] che suppongo 
significhino che hai snippato un po' di roba), questo a me funziona:
awk 'NR==1{sub(/\.txt \]/,"_svm ]");print;next}
     NR>2{s="| "$3;for(i=1;i<=17;i++)s=s OFS i":"$(i+3);print s} 
     END{print "`----"}' file.txt