Just as you would with items.cfg or anything alike. Use a symbol to distinguish the words (can be space, tabs (\t) or anything else) then split the read String (line) into a StringArray.
|
Well I am very rusty with java and am having problems using the bufferedreader/writer..
I need to know how to read and write data on the same line but seperately.
For example in my txt file i want to have:
the values in each column are stored in seperate arraylists. if you need more information to help, which im sure you will, just askCode:torque varrock you falador etc lumbridge
Just as you would with items.cfg or anything alike. Use a symbol to distinguish the words (can be space, tabs (\t) or anything else) then split the read String (line) into a StringArray.
if (token.equals("torque")
p.location = token2;
something like that, thats just a rough version of it
Code:List list1 = new List(); List list2 = new List() BuffRead in = new BuffRead(FileRead("in.txt"); Strng ln; while((ln = in.readLn()) != null) { list1.add(ln.split(regex)[0].trim()); list2.add(ln.split(regex)[1].trim()); }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |