Created
March 12, 2022 07:03
-
-
Save taka2/40b8e09e37f8d8c917df5e8966deed32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.util.List; | |
import java.util.Arrays; | |
import java.nio.file.*; | |
// 引数で渡されたCSVファイルから先頭2列を削除して標準出力に表示する。データ内のカンマについては考慮されていない。 | |
public class test { | |
public static void main(String[] args) throws Exception { | |
List<String> allLines = Files.readAllLines(new File(args[0]).toPath()); | |
for(String line : allLines) { | |
String[] splittedLine = line.split(","); | |
System.out.println(String.join(",", Arrays.copyOfRange(splittedLine, 2, splittedLine.length))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment