Recently, I came across a situation where I
need to extract the memo field data from an FPT file. After lot of googling I
found this documentation which describes the FPT structure and then I decided to
write my own code to parse the FPT file and extract the data stored in it.
public enum
MemoDataType
public class
MemoCollection :
IEnumerable<MemoBlock>
public MemoCollection(System.IO.Stream
memoStream)
#region IEnumerable<MemoBlock>
Members
A memo file (FPT) file contains one header and any number of block structures.
The header part is 512 bytes long but the useful information is stored in 7th
and 8th byte which is the size of the block structure.![]()
Following the header is the first memo block. A memo block consists of a memo
block header and memo text. Memo block is 8 bytes long and stores the type of
memo data and the length of the memo data. 
A memo block can span over multiple blocks structures but a single block can't
have data of more than one memo block. It means if block is larger than the memo
size then remaining block will be unused.
Here is the code to extract memo data.
public
class MemoBlock
{
public
MemoDataType MemoDataType { get;
private set; }
public Byte[]
Memo { get; private
set; }
public MemoBlock(MemoDataType
type, Byte[] data)
{
this.MemoDataType = type;
this.Memo = data;
}
}
{
Picture = 0
, Text = 1
}
{
private System.IO.Stream
Stream = null;
private int
blockSize = 0;
{
this.Stream = memoStream;
}
Join the conversation! Your thoughts help the community grow.