Click here to Skip to main content
15,887,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how do i get a keyword file generated with a specifc format taking the data from MS Access/SQLite db...plz help
Posted
Comments
ZurdoDev 6-May-14 21:52pm    
What is a kwd file?
Dave Kreskowiak 7-May-14 1:01am    
What the hell is a "kwd" file? Without knowing the file format, you're going to find it impossible to create the file. .NET doesn't have any classes that will do it for you, so you better know the file format so you can code it up yourself.

1 solution

Basically you have two types of files
ASCII files
Basically, this is just text. txt, csv, XML, HTML, ... are all examples of ASCII files. They can be opened in any text editor and all formatting is done by the application itself based upon the interpretation of that file. Often based on the extension. Open an XML file with a browser versus a notepad eg.

Binary files
These can be very complex to write and read. They often have headers or metadata in embedded in the file. Usually a specific application is needed to open such files although for many filetypes there are many applications because there were standards defined. Think of jpg, bmp, gif, wav, mp3 files for files with pretty well defined standards (which can be found on the internet) or doc, docx, xls, raw, tiff, ... files (also defined, but a little harder to find). The less the filetype is known (eg a custom built file for a company) the less information can be found on the format.

So basically if this kwd file is a binary file (even if it contains just text) you'll need to convert the data from your database into the correct format, including the minimum mandatory headers and metadata. Without knowing the format there's not much you can do. If you do know the format, you'll still need to find the right encoding (how the bytes are interpreted), but usually this is a standard encoding and is probably supported by .Net. If you have that you just need to write the algorithm to convert the data from the database to a valid byte value and append it to a file, just as you would do with a text file.

Hope this clarifies things for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900