I have two data structures:
atomName <855*1 cell>atomSASA <855*1 double>
which I am using in code to produce an output file:
%write out SASA values for individual atoms to file
results_file = fopen('output.txt','w');fprintf(results_file,'SASA for Individual Atoms: \n');i=1;while i < (855) fprintf(results_file,'Atom %s %s: %.3f\n',i,cell2mat(atomName(i)),atomSASA(i)); i = i + 1;end
The file seems correct for the first 32 lines, but starting at line 33, there is an extra character after the word Atom. The character changes each line, eventually going through digits, capital letters A-Z, lower letters a-z etc. I would like to remove this extra character from each line:
Atom ! HG23: 6.286Atom " N: 0.000Atom # CA: 0.000Atom $ C: 0.000Atom % O: 0.000
Atom & CB: 0.000Atom ' CG: 0.000Atom ( CD1: 0.000Atom ) CD2: 0.000Atom * CE1: 0.000Atom + CE2: 0.000Atom , CZ: 0.000Atom - OH: 0.000Atom . H: 0.000Atom / HA: 0.000Atom 0 HB2: 0.000Atom 1 HB3: 0.000Atom 2 HD1: 0.000Atom 3 HD2: 0.000Atom 4 HE1: 0.000Atom 5 HE2: 0.000Atom 6 HH: 0.000Atom 7 N: 0.000Atom 8 CA: 0.000Atom 9 C: 0.000Atom : O: 0.000Atom ; CB: 0.000Atom < CG: 0.000Atom = CD: 0.000Atom > CE: 1.208Atom ? NZ: 1.312Atom @ H: 0.000Atom A HA: 0.000Atom B HB2: 0.000Atom C HB3: 0.000Atom D HG2: 0.000Atom E HG3: 0.000Atom F HD2: 0.000Atom G HD3: 0.000Atom H HE2: 0.000Atom I HE3: 33.979Atom J HZ1: 0.000Atom K HZ2: 0.000Atom L HZ3: 44.513Atom M N: 0.000Atom N CA: 0.000Atom O C: 0.000Atom P O: 0.000Atom Q CB: 0.000Atom R CG: 0.000Atom S CD1: 0.000Atom T CD2: 0.000Atom U H: 0.000Atom V HA: 0.000Atom W HB2: 0.000Atom X HB3: 0.000Atom Y HG: 0.000Atom Z HD11: 0.000Atom [ HD12: 0.000Atom \ HD13: 0.000Atom ] HD21: 0.000Atom ^ HD22: 0.000Atom _ HD23: 0.000Atom ` N: 0.000Atom a CA: 0.000Atom b C: 0.000Atom c O: 0.000Atom d CB: 0.000Atom e CG1: 0.000Atom f CG2: 0.000
Best Answer