View Single Post
  #4 (permalink)  
Old 02-09-2010, 07:55 PM
Bryan Oakley
Guest
 
Posts: n/a
Default Re: Saving TABS/CRLF's from text widget. Best Way?

On Feb 9, 1:26 pm, GizmoGorilla <gizmogori...@hotmail.com> wrote:
>
> The tab is inserting blanks up to the column that was tabbed to.


.... so, you don't actually have tabs in the files, you have blocks of
consecutive spaces. Make sure when you describe a problem that you
describe it accurately.

> CRLF's will leave a blank line if there's no text on the line.
> That's fine for the user but not for the data file.
> If I crlf 5 times with no text on the line, I get 5 blank lines,
> in my data file. This is a huge waste of space,


five *bytes* is a huge waste of space? *bytes*? Even if you're talking
about one thousand blank lines, that's still only 1K. That's a
minuscule amount of disk space in this day and age, probably smaller
than the disk block size. Are you are a system that is seriously
constrained in space?

If you're concerned about disk space you should consider using a
standard compression scheme. Just run your data through zip/gzip and
that way any other wasteful characters will also get compressed.

Of course, you're doing this all to the inconvenience of the user who
will no longer be able to edit your text files with anything but your
tool (or, force them to unzip the file before editing it with some
other tool)

I don't mean to sound preachy, but it sounds like you're making a
beginners mistake of premature optimization. Don't worry about
compression until it actually proves to be a problem. Otherwise you'll
spend way too much time on something that just doesn't matter.


Reply With Quote