wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "serialization" Watch "serialization" New topic
Author

serialization

rahul arno
Greenhorn

Joined: Jul 02, 2011
Posts: 6

how can i copy the text data of xyz.html page to abc.txt page???
any one help me???
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

I'm not sure what you are asking and how it's related to serialization (the title of your thread). .txt and .html files aren't the same - of course they have textual content but HTML has a specific syntax. What exactly are you trying to do?

[My Blog] [JavaRanch Journal]
Guillaume Jourdan
Ranch Hand

Joined: Jul 24, 2012
Posts: 47

Hello,

If this is just a copy : http://www.roseindia.net/java/beginners/copyfile.shtml...

If you want to remove HTML tag : http://www.rgagnon.com/javadetails/java-0424.html

With an HTML parser is very simple :



http://jsoup.org/
rahul arno
Greenhorn

Joined: Jul 02, 2011
Posts: 6

sir actually i want to copy all text data from html file to txt file.
i do not understand how can i read the data of html file.
we normally save text data in .txt file using serialization.
so i think its a topic of serialization,if i am wrong you tell me how can i done it??
please help me
Guillaume Jourdan
Ranch Hand

Joined: Jul 24, 2012
Posts: 47

Use JSoup => http://jsoup.org/
Guillaume Jourdan
Ranch Hand

Joined: Jul 24, 2012
Posts: 47

And I'm agree with Jaikiran. Your topic is not a serialization topic. It's a topic on HTML parser.

If you want to discover java concept of serialization : http://java.sun.com/developer/technicalArticles/Programming/serialization/
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7029
    
  16

rahul arno wrote:we normally save text data in .txt file using serialization.

You do? Seems like a mighty odd way to do it to me.

If you literallly just want to copy the contents of the file blindly, then:
1. If you're on Java v6 or earlier, just open a FileInputStream and FileOutputStream to the relevant names and loop through the contents with read() and write(). There may even be slicker solutions available.
2. If you're on Java v7, use Files.copy().

But I suspect that Guillaume is right, and that you actually have something different in mind; but until you tell us what that is, it's difficult to advise.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: serialization
 
Similar Threads
How to deploy/undeploy EJBs application through HOT Deployment on websphere 6.1?
JSP
Happy New Year! Welcome to our new forums!
How to convert xml to pdf form in java
WA #1.....word association