Hello! I need help with splitting the elements of a text file and storing each element in an array of its type. I have the following text file:
The file follows the following format:
Type Cmpy Type# ID msrp discount quantity
The data in the file looks like this:
TV Philips 101 133-32-434 5000 3000 5
DVD Sony 612 414-55-908 8000 6000 13
I need to split this text file and store all type elements in type[], all cmpy elements in cmpy[] and so on..
SO my type array type[] will contain: TV, DVD,...
my cmpy array cmpy[] will contain: Philips, Sony....
Currently, I am able to read the data from the text file and display it as it is..but I am not able to split the file elements and store them in their own arrays..I tried everything from tokenizer to split() method and even scanner class..but have reached nowhere...pleas e help!!
The file follows the following format:
Type Cmpy Type# ID msrp discount quantity
The data in the file looks like this:
TV Philips 101 133-32-434 5000 3000 5
DVD Sony 612 414-55-908 8000 6000 13
I need to split this text file and store all type elements in type[], all cmpy elements in cmpy[] and so on..
SO my type array type[] will contain: TV, DVD,...
my cmpy array cmpy[] will contain: Philips, Sony....
Currently, I am able to read the data from the text file and display it as it is..but I am not able to split the file elements and store them in their own arrays..I tried everything from tokenizer to split() method and even scanner class..but have reached nowhere...pleas e help!!
Comment