我有一个文本文件,内容如下:
3NHE,A,503,LYS,NZ,10.246915660855539,正,A,444,PRO,CB 3NHE,A,440,ASP,OD1,11.166332392875592,正,A,439,TRP,CB 3NHE,B,42,ARG,NH1,8.076673650559258,正,B,44,ILE,CD1 3NHE,B,6,LYS,NZ,6.366139095873315,正,A,489,PHE,CD2 3NHE,A,503,LYS,NZ,10.246915660855539,正数,A,444,PRO,CG 3NHE,A,503,LYS,NZ,10.246915660855539,正,B,70,VAL,CB 3NHE,B,6,LYS,NZ,6.366139095873315,正,A,444,PRO,CG 3NHE,B,76,GLY,OXT,4.547711997741236,正值,A,277,PHE,CB
我想计算单词“ ASP和LYS”在整个文件中出现的次数 有人可以告诉我该怎么做吗? 答案示例是
ASP:5 赖斯:4
答案 0 :(得分:0)
假设您已经加载了数据,则可以在此处查看如何计算字符串中子字符串的出现次数:
Count number of occurrences of a given substring in a string