Easy way to compress txt file

Hello,
I have to compress a txt file before send it to my ftp server. This files will be 3-4 mb max (uncompressed).

I'm using now rar.exe (command line) with 'system', but in my software I would add an internal compressor and don't use rar.exe anymore (3 mb).

Have you some advice to compress just a txt file without external files?

thank you in advance for your attention
You can use a compression library like zlib:

http://www.zlib.net/

or 7zip/LZMA:

http://www.7-zip.org/sdk.html

Or another idea would be to replace words with a shorter number.
Topic archived. No new replies allowed.