This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The code right now will read in a file so that I can see the text, what I need to do and don't know how is take that text and replace it with other text along with adding txt. Then save it to a different location with a differnt name. Can anyone help me out please. Thank you in advance
What exactly are you having problems understanding? Where do you plan on going from here? What data do you need to add to the string that you read in? Where does it need to be added? What format is the data in the string when you read it in? If you can answer these questions and give us any other details about what you are trying to do, we will be able to help you much more easily and quickly. Regards, Layne
My problem is that I'm fairly new to Java and I don't understand how to do this. The first file is a .dat file(located at C:/Program Files/Client) I am already able to read this, but I need to make it look like the 2nd file(which won't exist yet)and save it in a different location. ex C:/program Files/Microsoft/ and saved as something.ctt //1st file Version=3.1.3 G 289f9;80256d8c/Administrators3 Administrators O G My;Group2 My;Group O U william.flentje1:: william.flentje,bill.flentje U bryan.miller1:: bryan.miller U david.kratzer1:: david.kratzer, U greg.mcbroom1:: greg.mcbroom, G Test2 Test O U kevin.leahy1:: kevin.leahy, U marcia.lemon1:: marcia.lemon, //2nd file to be created <?xml version="1.0"?> <messenger> <service name="Microsoft"> <contactlist> <contact>firstname.lastname@example.org</contact> <contact>email@example.com</contact> <contact>firstname.lastname@example.org</contact> <contact>email@example.com</contact> <contact>firstname.lastname@example.org</contact> <contact>email@example.com</contact> </contactlist> </service> </messenger> [ April 28, 2004: Message edited by: Chris Evans ]
Joined: Dec 06, 2001
The output file looks like XML. Are you required to write this text by hand or can you use any XML tools provided. From what I understand, Java provides classes that let you easily manipulate XML-style data, but I don't have any experience with this. I suspect that you should output the data as you read it from the file. By this I mean that each time you read a name from the first file, you can immediately write the appropriate line to the second file. Before you do this, you will also want to write the header information to the second file. I'm assuming that you can figure out how to open a file to write to it. The process is very similar to reading from a file. I hope this helps. Layne
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com