 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
janicethorne via JavaKB.c Guest
|
Posted: Thu Apr 20, 2006 4:12 pm Post subject: printing arrays from a file from the run command |
|
|
Hello:
My question involves how to set up an array to print from a file that is not
known until you implement the Run command. I know that it is run in the main
method, but don't know the proper syntax for calling them. For example, I
know that (String[ ] args) holds an array of args[0] (my input file) and arg
[1] (my output file). How do I use that to get my data?
Thank you.
--
"The man who does not read good books has no advantage over the man who
cannot read them."
Message posted via http://www.javakb.com |
|
| Back to top |
|
 |
Hendrik Maryns Guest
|
Posted: Thu Apr 20, 2006 5:12 pm Post subject: Re: printing arrays from a file from the run command |
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
janicethorne via JavaKB.com schreef:
| Quote: | Hello:
My question involves how to set up an array to print from a file that is not
known until you implement the Run command. I know that it is run in the main
method, but don't know the proper syntax for calling them. For example, I
know that (String[ ] args) holds an array of args[0] (my input file) and arg
[1] (my output file). How do I use that to get my data?
|
args[0] will be a String, so you probably want new File(args[0]), then
read in the file, and populate some array with it.
Afterwards, you’ll do new File(args[1]) and write out your data to it.
See the whole java IO stuff.
H.
- --
Hendrik Maryns
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFER7Lxe+7xMGD3itQRAsDuAJoCmTmtOCbbRaQl4YWPCV5HoRVpggCfSg+F
FiJPRPnxsJE6ejGBmeJgswY=
=kiaj
-----END PGP SIGNATURE----- |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|