473,395 Members | 1,624 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 binary file as hex

I'm using ASP to generate an RTF (rich text) file, via the FSO. No
problems with text, but when it comes to inserting images, the files
have to be embedded as either binary or hex.

Try as I might, I can't get binary to work (Word b0rks trying to open
the resulting file). When I create a simple RTF in Wordpad and then view
its source, Wordpad seems to be embedding the image as hex.

Does anyone have a suggestion as to how I could read an image file off
the disk in hex format for writing into my RTF?

Any suggestions gratefully received.

drew.
Jul 21 '05 #1
3 2924
DrewM <nu**@allinthehead.com> wrote in news:#G0A9PBwEHA.1976
@TK2MSFTNGP09.phx.gbl:

Have you checked out if there are any third party components that would
either do that, or at least do an intemediate conversion?

I'm using ASP to generate an RTF (rich text) file, via the FSO. No
problems with text, but when it comes to inserting images, the files
have to be embedded as either binary or hex.

Try as I might, I can't get binary to work (Word b0rks trying to open
the resulting file). When I create a simple RTF in Wordpad and then view
its source, Wordpad seems to be embedding the image as hex.

Does anyone have a suggestion as to how I could read an image file off
the disk in hex format for writing into my RTF?

Any suggestions gratefully received.

drew.


Jul 21 '05 #2
s_m_b wrote:
DrewM <nu**@allinthehead.com> wrote in news:#G0A9PBwEHA.1976
@TK2MSFTNGP09.phx.gbl:

Have you checked out if there are any third party components that would
either do that, or at least do an intemediate conversion?


Yes, but I haven't managed to find anything yet.

Thanks

drew.
Jul 21 '05 #3
"DrewM" <nu**@allinthehead.com> wrote in message
news:e$****************@TK2MSFTNGP10.phx.gbl...
: s_m_b wrote:
: > DrewM <nu**@allinthehead.com> wrote in news:#G0A9PBwEHA.1976
: > @TK2MSFTNGP09.phx.gbl:
: >
: > Have you checked out if there are any third party components that would
: > either do that, or at least do an intemediate conversion?
:
: Yes, but I haven't managed to find anything yet.

http://www.motobit.com/tips/detpg_re...nary-files.htm

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Guyon Morée | last post by:
what is the difference? if I open a text file in binary (rb) mode, it doesn't matter... the read() output is the same.
7
by: KantKwitDansin1 | last post by:
I have a file "a.dat" containing 10^4 32 bit binary numbers. I need to read in these numbers and deterimine if they are prime. The primality part I will have to figure out later, but I was...
3
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
1
by: Quinn | last post by:
Hi all, I have some binary files in the following format: text line 1 text line 2 .... text line N end of text single in binary 1 single in binary 2 single N EOF
3
by: utab | last post by:
Dear all, What are the advantages of binary files over text files? I would like to search for a specific value of a variable in an output file, I was doing this lately by the string library...
6
by: =?Utf-8?B?VGhvbWFzWg==?= | last post by:
Hi, Is it possible to read a file in reverse and only get the last 100 bytes in the file without reading the whole file from the begining? I have to get info from files that are in the last 100...
6
by: ericunfuk | last post by:
Hi ALL, I want to read a binary file(it's pic.tif file, I guess it's binary file?), then write it to a new file), I have several questions about this process: When I use fread() to read a...
6
by: Thomas Kowalski | last post by:
Hi, currently I am reading a huge (about 10-100 MB) text-file line by line using fstreams and getline. I wonder whether there is a faster way to read a file line by line (with std::string line)....
4
by: Matrixinline | last post by:
Hi All Here is my problem I am using a Unicode project and I tried to read the File like sPath = LPCTSTR; FILE* oFp = _tfopen(sPath,L"r"); while(!feof(oFp))
6
by: zl2k | last post by:
hi, there I have a appendable binary file of complex data structure named data.bin created by myself. It is written in the following format: number of Data, Data array Suppose I have...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.