定位单词位置

文件1中形式:

          T1 Protein 401 420 bcr-abl fusion gene
          T2 Protein 480 496 interferon alpha
          T3 Protein 498 507 IFN-alpha
          T4 Protein 683 713 interferon regulatory factor 4
          T5 Protein 715 720 IRF-4

文件2:就是普通的 txt 文本,


问题:文件1已经给出了字符串及其开始字符和结束字符的位置,在文件2中找出来:

  

                          for(int i = 0; i < fi.length; i++){
	        		
	        		name = fi[i].getName();
	        		m = name.lastIndexOf(".");
	        		
	        		if(name.substring(m + 1).equals("a1")){
		        		
	        			fileR = new FileReader("E:\\test\\" + name);
		        		buffR = new BufferedReader(fileR);
		        		
		        		fileW = new FileWriter("E:\\tessm\\" + name);
	        			buffW = new BufferedWriter(fileW);	        			
	        			char c[] = mp.paraprint();
	        			List mylist = mp.char_list(c);
	        			
	        			String temp;
	        			int y = 0;
		        		while((temp = buffR.readLine()) != null){ //读的是 a1 文件
		        			String str[] = temp.split(" ");
		        			int a = (Integer) Integer.parseInt(str[2]);
		        			int b = (Integer) Integer.parseInt(str[3]);
		        				
		        		    //int num =(b-a);
		        		    //String text = "";
		        			
		        		    for(int x = 0; x < mylist.size(); x++){
		        				if(x == a){
		        				       for(int j = 0; j < num; j++){
		        					   text = text + mylist.get(x+j);
		        					   
		        					}
		        					buffW.write("[" + text + "]");
		        					buffW.newLine();
				        			buffW.flush();*/
		        				}
		        			}
		        			
		        			
		        			//System.out.println("[" + text + "]");
		        		}
		        		
		        		mp.list_string(mylist);
	        	    }
	        	}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值