Re-ordering data

input

Predictions for job: 1299399580
**********************************************

gg18_qqq10_100017878_100017978_-
==============================================================================

zzz Factor: XXX, ttt: crsmsgw, Cutoff: 0.6429
seqe Position	fff Coordinate	K-mer     	Score   
26               	qqq10:100017953   	cgcccgg   	0.753   
65               	qqq10:100017914   	cgcccgc   	0.736   
76               	qqq10:100017903   	ccccgga   	0.809   

Calculation parameters:
-----------------------------
Scoring function: COS(WR)
Significant p-value: 0.005
Suboptimal p-value: 0.05
Window size: 50

*****************************************************************************************

gg18_qqq10_100017878_100017978_-
==============================================================================

zzz Factor: YYY, ttt: crsmsgw, Cutoff: 0.6429
seqe Position	fff Coordinate	K-mer     	Score   
26               	qqq10:100017953   	cgcccgg   	0.753   
65               	qqq10:100017914   	cgcccgc   	0.736   
76               	qqq10:100017903   	ccccgga   	0.809   

zzz Factor: ZZZ, ttt: ugcug, Cutoff: 0.6000
seqe Position	fff Coordinate	K-mer     	Score   
49               	qqq10:100017930   	cgcug     	0.671   
52               	qqq10:100017927   	ugcuc     	0.671   
  
Calculation parameters:
-----------------------------
Scoring function: COS(WR)
Significant p-value: 0.005
Suboptimal p-value: 0.05
Window size: 50

*****************************************************************************************

output

qqq	start	end	strand	zzzFactor	ttt	cut-off	seq_poistion	kmer_location	K-mer	Score			
qqq10	100017878	100017978	-	XXX	crsmgw	0.6429	26	qqq10:100017953	cgccga	0.753
qqq10	100017878	100017978	-	YYY	crsmgw	0.6429	26	qqq10:100017953	cgccga	0.753
.........................................

How about this:

awk '
BEGIN { OFS="\t" ; print "qqq", "start", "end", "strand", "zzFactor", "ttt", "cut-off", "seq_position", "kmer_location", "k-mer", "Score" }
/^gg18/ {split($0,f,"_"); s=f[3];strand=f[4];qqq=f[2]; zzz=f[5]; }
/^zzz Factor: /&&s {gsub(",","");zzz=$3;ttt=$5;cutoff=$7}
n { print qqq,s,"",strand,zzz,ttt,cutoff,$1,$2,$3,$4; s=n=0 }
/^seqe/&&s { n=1 }' infile

Thanx Chubler. Only problem is that strand column is missing.

qqq	start	end	strand	zzFactor	ttt	cut-off	seq_position	kmer_location	k-mer	Score
qqq10	100017878		100017978	XXX	crsmsgw	0.6429	26	qqq10:100017953	cgcccgg	0.753
qqq10	100017878		100017978	YYY	crsmsgw	0.6429	26	qqq10:100017953	cgcccgg	0.753

This should fix it:

awk '
BEGIN { OFS="\t" ; print "qqq", "start", "end", "strand", "zzFactor", "ttt", "cut-off", "seq_position", "kmer_location", "k-mer", "Score" }
/^gg18/ {split($0,f,"_"); s=f[3];e=f[4];qqq=f[2]; strand=f[5]; }
/^zzz Factor: /&&s {gsub(",","");zzz=$3;ttt=$5;cutoff=$7}
n { print qqq,s,e,strand,zzz,ttt,cutoff,$1,$2,$3,$4; s=n=0 }
/^seqe/&&s { n=1 }
' infile