I have to read commands from a file I have and take necessary actions according to each command. I was able to find out the process of reading from the file and what the command is, but I am having trouble transferring the specific information contained in the command to the program. As an example, the line read is as follows
Add id:12 name:"Sandik" singer:"Muslum Gurses" year:2009 count:5 price:20
I have separated this reading line in each space as u can see in below.
Scanner scan = new Scanner(new File(args[0]));
while (scan.hasNextLine()) {
String data = scan.nextLine();
String[] readedCommand = data.split(" ");
After this operation, readedCommands[0]
gives me the read command. For the above example, readedCommands[0] = "Add"
After this step, I need to extract the information from the rest of the command, but I have no idea how to extract information such as id, name, singer. I will be grateful if you could help me. Thank you in advance.