in reply to how to use printf correctly...

If I understand you correctly, you have an input file with four fields per line. You want to discard the first two, and join the last two like this "G/A". You then want to print every 90th of these as a new column on each line to produce 90 lines of 301 columns. (I'm ignoring the fact that 90*301 != 10,000 :).

This sample code shows one way to do this...I've done 3 lines of 34 to save a little space:)

#! perl -slw use strict; # Read the file, split into fields, discard the first 2 # join fields 2/3 as required for output. my @data = map{ join '/', (split ' ')[2,3] } <DATA>; my @lines; # Array in which to accumulate the output. # build each output line for my $line ( 0 .. 2 ) { # 0 .. 89 in your app # by steping through the input and appending every nth element to +the output for my $col ( 0 .. 33 ) { # 0 .. 300 in your app $lines[ $line ] .= $data[ $line * 34 + $col ] . ' '; } } # display the output. print for @lines;
__DATA__ 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A 000217 P015 A G 000217 P016 A G 000217 P008 N N 000217 P009 G G 000217 P010 A A 000217 P011 A G 000217 P012 A A 000217 P013 A G 000217 P014 A A

Output

P:\test>junk N/N G/G A/A A/G A/A A/G A/A A/G A/G N/N G/G A/A A/G A/A A/G A/A A/G A/ +G N/N G/G A/A A/G A/A A/G A/A A/G A/G N/N G/G A/A A/G A/A A/G A/A N/N G/G A/A A/G A/A A/G A/A A/G A/G N/N G/G A/A A/G A/A A/G A/A A/G A/ +G N/N G/G A/A A/G A/A A/G A/A A/G A/G N/N G/G A/A A/G A/A A/G A/A N/N G/G A/A A/G A/A A/G A/A A/G A/G N/N G/G A/A A/G A/A A/G A/A A/G A/ +G N/N G/G A/A A/G A/A A/G A/A A/G A/G N/N G/G A/A A/G A/A A/G A/A

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller