File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes case statement, import file, output file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "case statement, import file, output file" Watch "case statement, import file, output file" New topic
Author

case statement, import file, output file

Lily Zulkipli
Greenhorn

Joined: Sep 22, 2011
Posts: 8
Hello, to run a program, I must include text file.
When I run, I must keep my files running from the text file.

Here is the text file.


a 54 AB123 Orange Pte Ltd
A 100 CD456 Apple Pte Ltd
A 153 EF778 XYZ Pte Ltd
a 2415 GH123 Mango Pte Ltd
B 14 IJ456 Xin Yin Pte Ltd
B 20 KL789 Mangnolia Pte Ltd
b 110 MN123 Fresh Mango Pte Ltd
b 117 OP456 Kiwi Pte Ltd
B 6 XT123 Banana Pte Ltd

There are 100kg, 20kg, 10kg and 5kg provided.

(Note that: 'A' or 'a' cannot accept 100 kg)
(Note that: 'B' or 'b' cannot accept 100 kg and 20 kg)

and coding.




the output must be in terms of this:


EXCELLENT FERTILIZER WHOLESALER SDN BHD
WEEKLY ORDER REPORT

_________________________________________________________________________________________________________________
RETAILER YZ123 SUPREME EXCELLENT PTE LTD
_________________________________________________________________________________________________________________

ORDER: 10 KG

10 KG SACKS 1

TOTAL NUMBER OF SACKS: 1

ORDER SHORT BY: 0 KG

INVOICE: $11.70




_________________________________________________________________________________________________________________
SUMMARY
_________________________________________________________________________________________________________________

1 ORDERS PROCESSED

10 KG SACKS 1

TOTAL NUMBER OF SACKS: 1

ORDER SHORT BY: 0 KG

TOTAL AMOUNT INVOICED: $11.70



the case A is still not working. thus cannot run :/
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

What do you mean by "not working"?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Lily Zulkipli
Greenhorn

Joined: Sep 22, 2011
Posts: 8
i try to run, but the program is not working. so i guess there's must be something wrong with my case statement perhaps?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

Again, what do you mean by "not working"? Do you mean that your computer blue-screens? That clicking the Run button (or menu item) does absolutely nothing at all? Or that Eclipse crashes? Or do you mean that the app runs but you get an exception? Or do you mean that the app runs but you don't get the results you though you would get? Or is it something else? Please tell us the exact behavior you are seeing when you attempt to run the app.


JBoss In Action
Lily Zulkipli
Greenhorn

Joined: Sep 22, 2011
Posts: 8
"or do you mean that the app runs but you get an exception?"

"do you mean that the app runs but you don't get the results you though you would get"

yes i was talking about these part, i was wondering what my mistakes are in the coding. sigh
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

If you are getting an exception, post the exception stack trace.

If the app is not behaving as you expect, tell us exactly what the app is doing, and what it should be doing instead. In other words, tell us what you want the app to do (be very specific), and then tell use what the app is doing 9once again, be very specific)

Bottom line: we cannot help you if you do not TellTheDetails
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: case statement, import file, output file