If the goal is to simply count the secondary structure, pass the dssp output file through grep "__" dssp_output.xpm | wc Fill in the dssp code for each secondary structure in the underline separately. Grep would extract all characters that fit that pattern and wc would count it. Hope that helps. Ali