단일 열에 문자열 목록이 있습니다. 이 문자열에서 세 개의 열을 만들고 출력을 다른 파일로 인쇄하려고합니다. 어떻게해야합니까?문자열을 열로 나누는 방법
ArrayList<String> list=new ArrayList<String>();
File file = new File("f://file.txt");
try {
Scanner scanner = new Scanner(file);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
System.out.println(line);
}
scanner.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
내 입력 데이터 :
City
Gsk
Relocation
sripallu
here
jrajesh
gurgaon
unitech
StatisticsThreads
WizOty
LTDParsvnathK
Quotesby
newest
PMaashuktr
내 예상 출력 :
City Gsk Relocation
sripallu here jrajesh
gurgaon unitech StatisticsThreads
WizOty LTDParsvnathK Quotesby
newest PMaashuktr Loans
.
.
.
.
.
.
.
은 어떻게 열을 분할 할 계획입니까? 구분 기호 란 무엇입니까? – Swapnil
출력 분할 또는 구분 기호 구분 기호는? –
'내가 시도한 코드 '여기 열을 나누기위한 논리를 볼 수 없습니다. 이것은 시도가 아닙니다 !! –