in reply to Re: Printing ten characters succeeding a matching string (+ followup question)
in thread Printing ten characters succeeding a matching string

Hello ww,

Thanks for your input. Though, I was able to compile it using the previous replies, I still has to create a header in the output file. The input file doesn't have header and it starts from the first line. All the input files I have worked before have some headings, so it was easy to reference it or add a new columnheader.

I am also thinking about getting the frequency of the ten characters. That is, if there are more than one matching ten character list, I would like to print it only once and on the second column, the number of times it was found.

  • Comment on Re^2: Printing ten characters succeeding a matching string (+ followup question)

Replies are listed 'Best First'.
Re^3: Printing ten characters succeeding a matching string (+ followup question)
by Caio (Acolyte) on Oct 28, 2011 at 10:29 UTC
    if you want to count and calculate frquencies for the 10 characters after matches i'd sugest you make a hash, and populate it dynamically, with some:

    if ($1) { say "\t Next 10 char after the match: $1"; $hash{$1}++; next; }
    just a slight modification... ;)

    update: Corrected typo pointed out by roboticus. Thanks ;)