<p>Hi all,</p>

<p>Any script available for doing sequence length disrtibution of fastq file?</p>

<p>Thanks,
Deepthi</p>

Here is a solution using `awk`:

    awk 'NR%4 == 2 {lengths[length($0)]++} END {for (l in lengths) {print l, lengths[l]}}' file.fastq

It reads like this: every second line in every group of 4 lines (the sequence line), measure the length of the sequence and increment the array cell corresponding to that length. When all lines have been read, loop over the array to print its content. In `awk`, arrays and array cells are initialized when they are called for the first time, no need to initialize them before.