473,395 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Read the properties of a document through a java program

when we right-click and check the properties of any microsoft document or excel sheet, we have some attributes like "title","author" etc..

i want to get those properties through java and create an XML file.

How do i read those properties?

of course i can create an XML after getting those properties....

Please help me .....
Apr 11 '07 #1
2 1361
My problem is that whenever i upload a document ... an xml file should get generated with the property attributes of that document


someone can help me out please?
Apr 11 '07 #2
I solved this upto some extent

use this code:

import java.io.*;
import java.util.*;
public class Props
{
public static void main(String args[]) throws IOException
{
FileInputStream is = new FileInputStream("sample.doc");
FileOutputStream fos = new FileOutputStream("samp.txt");
Properties prop = new Properties();
prop.load(is);
prop.store(fos,"Heading");
}
}

For this program an output file samp.txt is generated for some document called "sample.doc"
Now from the text file i need to extract the Values because the actual attributes are listed in the file but not in order.

Can anyone please help me extract the key-value pairs for these attributes from that file?
Apr 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Simon Wigzell | last post by:
I recently wrote a program with MS Visual Studio C++, sent it off to the client where it didn't run, after some probing I discover they are on a Mac! My program is a MSF interface that is really...
1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
0
by: Xavier Seneque | last post by:
hello, i'm trying to parse an XML file from a java program, and the structure of the XML document is described in a schema file. here is the simple schema file (departement.xsd) : <?xml...
3
by: ytrewq | last post by:
Should dynamic ("expando") properties be restricted to native and user-defined objects? Or should host objects - such as references to the browser or a plug-in or to the document and its elements -...
3
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their...
2
by: Brown Smith | last post by:
How to get the browser window properties at run time through java script code? When my ASP.Net application is launched (through IE only) I am interested with the following properties from client...
1
by: mitra4umohit | last post by:
Hi, I am novice user of JavaScript. I have written one jsp with java script as given below. On click on hyperlink "User Link" my FireFox firebug says "document.frm has no properties" code...
20
by: Artur Siekielski | last post by:
Hi. I would like to have declarative properties in Python, ie. something like slots definitions in defclass in Common Lisp. It seems that even Java will have it, using a library (...
4
by: Venkatraman.S. | last post by:
Hi, Am sure many would have stumbled on this situation while developing an application in Python which is highly driven by configuration/ properties. I have an application (obviously written...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.