Created
April 2, 2017 23:21
-
-
Save randomtestfive/777b41631c52b9b7b9d062f289634246 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package csvconvert; | |
| import java.util.Scanner; | |
| public class Convert | |
| { | |
| public static void main(String[] args) | |
| { | |
| //change /frccsv.csv to filename (absolute) | |
| Scanner s = new Scanner(Convert.class.getResourceAsStream("/frccsv.csv")); | |
| s.useDelimiter(""); | |
| int sx = 0; | |
| int x = 0; | |
| int y = 160; | |
| System.out.print("placeBot.tiles = ["); | |
| String o = ""; | |
| while(s.hasNextLine()) | |
| { | |
| String q = s.nextLine(); | |
| String[] v = q.split(","); | |
| for(String p : v) | |
| { | |
| o+="[" + x + "," + y + "," + p + "],"; | |
| x++; | |
| } | |
| x = sx; | |
| y++; | |
| } | |
| s.close(); | |
| o = o.substring(0, o.length()-1); | |
| System.out.println(o + "];"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment