저는 현재 Java를 배우고 있으며, 많은 수의 행으로 구성된 파일을로드하려는이 문제에 직면했습니다 (행마다 파일을 읽음)하고 싶은 것은 특정 행을 건너 뜁니다 (의사 -암호).java의 텍스트 파일에서 특정 줄을 건너 뛰는 방법은 무엇입니까?
the line thats starts with (specific word such as "ABC")
나는
if(line.startwith("abc"))
를 사용하려고 노력하지만 그것은 작동하지 않았다.
public String loadfile(.........){
//here goes the variables
try {
File data= new File(dataFile);
if (data.exists()) {
br = new BufferedReader(new FileReader(dataFile));
while ((thisLine = br.readLine()) != null) {
if (thisLine.length() > 0) {
tmpLine = thisLine.toString();
tmpLine2 = tmpLine.split(......);
[...]
+1. 이유가 확실하지 않은 이유는 모르겠지만 다시 – Neil
-1 java-ee 서블릿이나 jsp 및 이미 삭제 된 게시물의 복사본과 아무 관계가 없습니다. –
+1 투표가 중단되었는지 확실하지 않습니다. 잘못된 태그가 있으면 그냥 수정하십시오. – devsnd