rosin tuck

+ Follow
since Jan 26, 2006
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rosin tuck

Hey i have written a method to take two lists of strings as input, merge these two lists together, then go through each list individually and if it contains a word in the merge list, to return 1 otherwise return 0. However currently this only checks if the "exact" same string is in the list, as in it is case sensitive, i need it to be case insensitive for what i am trying to do

The return statement here is redundant i am just returning an int to test the method. Does anybody know how i can perform the same test while ignoring case? I would appreciate any help
16 years ago
sorry im just trying to test that code but i cant get it to work. Not sure i follow the last bit you sent

Iterator itr = fin.iterator();
Object obj =;
if (obj instanceof List)

how come there is a 1 in the line splitList(fin,1)?
16 years ago
Thanks for the quick response! That is very close to what i am trying to do. The output now is the entire list of lists, combined together forming one list. What i need to do however is have a seperate list for each of the lists inside the outer list.
So using if your example contained another list like below:

it would return

Do you know how to make this distinction between the lists?
16 years ago
I have a list composed of lists of lists, looking this:
[[[hello, one, two, three],[four, to, the][six]],[[k][block, three, nine]],...
and so on.
What i need to do is seperate each individual list of lists, as below,
[[hello, one, two, three],[four, to, the],[six]]
[[k],[block, three, nine]]....

I then need to merge the individual lists inside thes lists together, like below:
[hello, one, two, three, four, to, the, six]
[k, block, three, nine]

I have written some code to iterate through the list, and find the inner list of list, which i want to merge together.

I dont however know what to do from here, i cannot find a way to store just the individual inner lists in seperate lists, so they can then be iterated through and their inside lists merged together. Does anybody know how to do this, or something to the same effect? I would greatly appreciate any help
16 years ago
Hi i need help with a simple I/O problem. I have a large text file, which i want to break up into smaller files. I want to break the file each time "From -" is found at the start of a new line.

public static void main(String[] args) throws Exception {

String path1 = "file1";

BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(path1)));

BufferedWriter out = new BufferedWriter(new FileWriter("Emails//out.txt"));
String line;
while((line = br.readLine()) != null)
if(line.startsWith("From -")){

//send from here to the next "from -" into a text file

Above is as far as ive come, i dont know how to send each block of text to an individual file, can anybody help, it would be greatly appreciated!
17 years ago