Text File to Binary

  • Thread starter Thread starter Mythran
  • Start date Start date
M

Mythran

Stuck.

I have a bunch of rather large text files filling up space that will be archived
and stored for future references. These are all XML files that are 10+ mb each
(not too big but not small either). Is there a way to convert these xml files to
binary which would make the file smaller? If so, how?

I've taken a look (and tested) the Text.Encoding classes/methods and was able to
convert to binary (but of course they were still all text). So, just writing
through a binary stream wasn't enough. I tried using convert() to convert to a
different encoding, but then again, that's not converting to binary, just UTF8,
7, ascii or unicode.

Also, we do not want it readable by text editors. As in, if someone opened it up
in a text editor, it would look garbled (hence, binary format). This is a
separate need and we can encrypt if required, just need to figure out the above
questions first. =p)


Mythran
 
Oh well.

How about (instead of compressing) somehow scrambling them or something so
we can make them binary (basically, what we need is when we view them in
notepad...they should not be readable/plain text.)

Thanks,
Mythran
 
* "Mythran said:
How about (instead of compressing) somehow scrambling them or something so
we can make them binary (basically, what we need is when we view them in
notepad...they should not be readable/plain text.)

Maybe encryption, but you need a way to recover the XML data, so
compression, maybe using a password, is IMO the easiest way.
 
On linux, and c, I can open a file as binary, write to it a large string,
close it and then open it in a text editor and not be able to read the
contents. So, I'm guessing this is all part of linux or c and not something
we have as an immediate option in VB.Net?

thanks,

Mythran
 
Hi Mythran,

When you read an A as an a and write it to file as an byte with the decimal
value 65 it will stay an A.

You need some conversion, however that showed Herfried in my opinion.
(You can use of course also the encryption classes like Rijndael)

Cor
 
* "Mythran said:
On linux, and c, I can open a file as binary, write to it a large string,
close it and then open it in a text editor and not be able to read the
contents.

Mhm... What command do you use to write the file?
 
Back
Top