aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes point me to the right place please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "point me to the right place please" Watch "point me to the right place please" New topic
Author

point me to the right place please

Andreas Koufalis
Greenhorn

Joined: Mar 01, 2013
Posts: 5
Hey people.. i am new around here.
I have a website and it's product list needs to be updated daily by uploading the contents of an excel file.
So here's what i want to do:
I want to make an application that can connect to the ftp server and
1) parse the excel file located on the ftp server,
2) compare it's contents with the ones of the new excel file,
3) and set the quantity of the products that don't exist in the new list equal to '0' so i can hide them with the help of walmart.

The problem is that my java-knowledge is kind of poor and i'm not sure where to search for information.
Google was a good start but it's results are chaotic.. people in various forums throwing arround bits and pieces of the code needed etc.
Do you know of any freeware or comercial Applications that can do that already?
otherwise could you point me at the right direction (for example do you have any books in mind that can help?)?

thanks.

p.s i hope my post is not off-topic, but i couldn't find more suitable category for my 'request'.

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2615
    
    9

Welcome to the Ranch.

So what part you need help with? Download file/ connect to FTP part or parsing the file?

For FTP, I would recommend you search for Jsch. And for parsing, unless you want to Java IO package, POI and OpenCSV (depending on your actual file) are good open-source libraries you can use.

You will still need to understand the provided API in order to do what you intend to do.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Andreas Koufalis
Greenhorn

Joined: Mar 01, 2013
Posts: 5
Hello and thanks for the answer and the welcome... The connecting part is easy .. kind of. I remember using sockets to do something similar during my "distributed systems" lessons back in the university, so i don't think it's going to be that hard to do it.
The parsing part on the other hand, is pretty troublesome / worrisome, since it's not just a text file that needs to be read, but a whole excel document with various functions and stuff inside it so ... i found a couple of methods to do it, (bits and pieces, without any particular explanation) and i am not sure which is the ideal one.
Do i go line by line or cell by cell or what?
Are the excel functions going to cause me extra problems during the "translation" in java?

I think i am a little more familiar with the IO package. Can i find what i need in the package's documentation (If such a thing even exists)?
That's all for now .. i hope i am not asking too much.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2615
    
    9

If excel or other MS your files then POI is your library. But first you need to know how the excel sheet looks then create or map that in java row by row, cell by cell.

Check out http://poi.apache.org/index.html for examples and download.
Andreas Koufalis
Greenhorn

Joined: Mar 01, 2013
Posts: 5
I was thinking how to do it, searching for documentations and stuff when this question occured to me..

Let's assume that i compare the 2 excel files line-by-line and cell-by-cell .
What happens if the old file had ProductName1 in Cell A3 but the new excel has another product in this cell (since they are sorted alphabetically) and still has ProductName1, but in a different cell?

Isn't that going to cause some trouble? I think i am over my head so i am just trying to understand a little bit more before giving up on the idea.
thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
None of this sounds hard (although it may feel like that for you if you really are a beginner with Java), but can you elaborate on what you mean by "i can hide them with the help of walmart."? I can't make sense of that sentence.
Andreas Koufalis
Greenhorn

Joined: Mar 01, 2013
Posts: 5
Ulf Dittmer wrote:None of this sounds hard (although it may feel like that for you if you really are a beginner with Java), but can you elaborate on what you mean by "i can hide them with the help of walmart."? I can't make sense of that sentence.


Lol sorry i meant VirtueMart i always confuse it's name with walmart for some reason :P

Virtuemart has an option that lets you hide the products with quantity=0 from the clients.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: point me to the right place please