Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

how can i take commands from file

Thread view: 
onurdundar1987@gmail.com - 26 Nov 2007 17:45 GMT
i have a project and it wants from me to take the commands from file
such

>> search  -to  -name Dubya Lilith

we have to take this command from file.

Example descripton

>> java MyProject input1.dat input2.dat

Begin Transaction Log
4 records are added to transaction table:
Record 1: 12.10.2007; +90 (532) 5555555; +1 (841) 4444444
Record 2: 14.10.2007; +1 (841) 4444444; +90 (542) 3333333
Record 3: 14.10.2007; +90 (532) 5555555; +90 (532) 1111111
Record 4: 20.10.2007; +90 (532) 1111111; +90 (532) 5555555
End of Transaction Log
Begin Owner Log
4 records are added to owner table, 0 ignored, 0 overridden :
Record 1: John Michael Moore; +90 (532) 5555555
Record 2: Dubya Bush;    +1 (841) 4444444
Record 3: George Erdogan; +90 (542) 3333333
Record 4: Abdullah Kaktus; +90 (532) 1111111
End of Owner Log

>> search  -to  -name Dubya Bush

On 12.10.2007 From: John Michael Moore To: Dubya Bush

my project is that we will take inputs from file and commands too.
input1.dat has transactions and input2.dat has phone number owners.
we will output results in another file query.dat
Roedy Green - 28 Nov 2007 05:59 GMT
>Record 1: 12.10.2007; +90 (532) 5555555; +1 (841) 4444444

You first problem is to read this. you might do it with readLine and
regex split, and a little indexOf to filter out junk.

see http://mindprod.com/applet/fileio.html for how to read the lines.
see http://mindprod.com/jgloss/regex.html#SPLIT for how to split the
lines up.
see http://mindprod.com/jgloss/string.html for misc string methods.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.