Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss. print.
FTT: FILE TO TEXT

Introduction: What is FTT?
FTT means converting any binary/ascii file into plain text. This technique removes the complexity of ascii conversion such as 0x00, 0x01, ... etc. but rather, it simplifies the conversion using the characters that can be found at your keyboard like a...z, A...Z and 0...9.

Hence, the converted file to text can be reversed to the original file and will be called as text to file.

Advantage of using FTT
1. If you have problems with your mails, simply because of security issues, and it complicates your life because Mr. Administrator blocks it, you can still send a file using FTT. You can do this by sending a file as text shown below:



You will notice that there is a tag ----- BEGIN FILETOTXT ----- and ----- END FILETOTXT ------. Any text written in this block is actually a file in such a way that I made a logical algorithm to determine what ascii code it fits. Therefore, once the mail as plain text was received, it can be converted to a file. And there is no attachment.

2. If you have friends on the web and you want to exchange information such as files, bitmaps, installers or videos, yet you don’t want to give or post your e-mail address, FTT is what you need.


For an example, you are in a forum and you want to give somebody a file, yet you don’t want to give your e-mail address since it is confidential. FTT can convert your binary file to text and since it is text, you can paste it in the forum. Not unless that forum prohibits a very long text, either way, you can truncate the remaining text and paste it to another link (that’s a work around but very tedious). See below:


>>Hey do you want a smiley? Post your email here
So I can send you the bitmap? – Posted by John
>> I’m sorry I can’t post my e-mail address, I am the owner
of KamoteSoft Corp., people might spam me! – Posted by Pedro
>> Ok, I’ll just attach it as text here,

----- BEGIN FILETOTXT -----
CODING: MZ-CODING
FILENAME: d:\mzproj\filetotxt\smiley.bmp
FILESIZE: 3126
@BM6#B@______6___#Z@___~___~___#1@_#M@______#B@__$x#C@__$x#C@___
_______%uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@____________%
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
uuuuuuuu@_____________%uu@_%uu@_%uu@_%uu@____________%uuuuuuuuuu
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@_______%uu@_%uu@_%u
u@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@______%uuuuuuuuuu
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@____%uu@_%uu@_%uu@_%uu@_%uu@
_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@___%uuuuu
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@_______%uu@_%uu@_%uu@_%uu@_%uu@_

--- (the rest of the text was cut) --------->

_%uuuuuuuuuuuuuuuuuuuuuuuuuuu@_______%uu@_%uu@_%uu@_%uu@_%uu@_%u
u@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@__
____%uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@____%uu@_%uu@_%uu@_%uu
@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@___
%uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@_______%uu@_%uu@_
%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@_%uu@______%uuuuuuuu
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@_____________%uu@
_%uu@_%uu@_%uu@____________%uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu@____________%uuuuuuuuuuuuuu
uuuuuuuuuuuuuuuuuuuuuuuuuuuu
----- END FILETOTXT -----
- Posted by John

>> Thanx! – Posted by Pedro


How to Use FTT
1. Run filetotxt.exe
2. Click the ellipsis to select a file. Let’s say, we choose smiley.bmp.





3. Choose “Hex Coding” or “Mz Coding”. Either of the two will do. However, the “Mz Coding” converts the file to a smaller size of text. Most of the characters there are readable, just like when you convert the notepad.exe to text, you can see the dll names, dialog messages, etc. there.
4. Click the button “Copy To Clipboard” and it will prompt you a ‘Done!’ message.



5. Now, you can paste the content of the clipboard to your new composed mail or in the forum.


Reversing The Polarity
1. Once, the recipient receives the text, he needs to highlight the text starting from “----- BEGIN FILETOTXT -----“ up to “------ END FILETOTXT ------“.
2. Run filetotxt.exe
3. Select the page, “Text To File”. Then select the folder to which you want to save it.



4. Click the button “Save From Clipboard”. Note that we don’t need to specify the filename since the data in the clipboard contains it. Thus, if it is d:\mzproj\filetotxt\smiley.bmp, it will automatically save the file as c:\temp\smiley.bmp.

Download code
Click here to download the code that is discussed in this article. The download is a zipfile. Its size is 132,012 bytes.

ABOUT THE AUTHOR: MZ

Mz David has been programming the Fox since 1999. He graduated as a mathematician in 1996. David's main line of business is POS (Point of Sale) and Inventory Systems. He has developped different POSWares in C, Progress, Delphi, FoxDOS 2.6, Clipper and VFP. David currently is the head of the development department of his company Applied Ideas.

FEEDBACK

chandrashekhar patil @ 5/15/2007 3:53:27 PM
good and fantastic project

AMM @ 12/12/2009 7:36:46 PM
HALLO MR : MZ
WE START TO ANALISIZE THE RELATION BETWEEN LOGARRETHMIC AND BIO MATHEMATIC SENCE 2005 DEPENDING ON BINARY AND LAB TESTS, ITS VERY COMPL
DOU THINK THAT YOU CAN SUBMIT HELP IN THAT?



Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: