Auto formatting tool for pure text documents?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Auto formatting tool for pure text documents?
Is there a feature/plug-in in TextPad which formats pure text documents in such way that it makes a linebreak every nth char? I want some kind of standard look -- not all file-editors have word-wrapping on by default.
Also, if there is such a thing, does it also create spaces between words when there's "too little" text on one line to fill it up completely (like two spaces instead of one between some words)?
Also, if there is such a thing, does it also create spaces between words when there's "too little" text on one line to fill it up completely (like two spaces instead of one between some words)?
- A bit iffy
- Posts: 15
- Joined: Thu Sep 16, 2004 1:15 pm
- Location: Brighton, England
Is this what you want?
http://www.textpad.info/forum/viewtopic.php?t=6035
http://www.textpad.info/forum/viewtopic.php?t=6035
No... it does what I want as long as I have TextPad open, but in my browser, it's still not word-wrapped with \ns.A bit iffy wrote:Is this what you want?
http://www.textpad.info/forum/viewtopic.php?t=6035
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
If your browser thinks that your file contains HTML it will treat newlines the same as spaces.
In what sense is the text not word-wrapped? Does it extend beyond the right margin of the browser?
Are there sufficient spaces in the text at which the lines can be broken?
Which browser are you using?
What is the file name extension?
How are you opening the file?
In what sense is the text not word-wrapped? Does it extend beyond the right margin of the browser?
Are there sufficient spaces in the text at which the lines can be broken?
Which browser are you using?
What is the file name extension?
How are you opening the file?
It doesn't. I serve text files as text filesben_josephs wrote:If your browser thinks that your file contains HTML it will treat newlines the same as spaces.
In what sense is the text not word-wrapped? Does it extend beyond the right margin of the browser?
Are there sufficient spaces in the text at which the lines can be broken?
Which browser are you using?
What is the file name extension?
How are you opening the file?
In the Web browser (Opera), it is not word-wrapped in the sense that it looks just like it used to -- looong lines.
A long line is indeed shown as a long line in a browser.
I have found no "wrap" function in a browser until this time.
Do you use Unix style line breaks? There could be a problem too.
The fact that a browser can show text files is just a 'bonus'. It is not another way of showing textfiles with formatting. If you are very keen on keeping the formatting just right, use another program to format things (PDF/Word etc).
Are you just letting users see textfiles without changing the textfiles themselves? That way you never get formatting to work.
If they only need to see a formatted textfile, put an HTML envelope around the textfile and use replace to change the EOL into <BR>.
You can also do a change after the nth column into <BR>. Use a regular expression to do this. There are examples of this in this forum.
An automated tool could be PHP. Then you can read in the textfile, and after the nth position, put in the <BR>. Make it into a class and you can use it for every textfile. There are examples of this on the PHP website (www.php.net) and many others.
Regards,
Jan Paul
I have found no "wrap" function in a browser until this time.
Do you use Unix style line breaks? There could be a problem too.
The fact that a browser can show text files is just a 'bonus'. It is not another way of showing textfiles with formatting. If you are very keen on keeping the formatting just right, use another program to format things (PDF/Word etc).
Are you just letting users see textfiles without changing the textfiles themselves? That way you never get formatting to work.
If they only need to see a formatted textfile, put an HTML envelope around the textfile and use replace to change the EOL into <BR>.
You can also do a change after the nth column into <BR>. Use a regular expression to do this. There are examples of this in this forum.
An automated tool could be PHP. Then you can read in the textfile, and after the nth position, put in the <BR>. Make it into a class and you can use it for every textfile. There are examples of this on the PHP website (www.php.net) and many others.
Regards,
Jan Paul
I don't have a single problem doing this embedded in HTML. The thing is that I provide the alternative for my users to read the text-file being embedded (user agreement) as pure text, and I'd PREFER if they saw it properly formatted.Jan Paul wrote:A long line is indeed shown as a long line in a browser.
I have found no "wrap" function in a browser until this time.
Do you use Unix style line breaks? There could be a problem too.
The fact that a browser can show text files is just a 'bonus'. It is not another way of showing textfiles with formatting. If you are very keen on keeping the formatting just right, use another program to format things (PDF/Word etc).
Are you just letting users see textfiles without changing the textfiles themselves? That way you never get formatting to work.
If they only need to see a formatted textfile, put an HTML envelope around the textfile and use replace to change the EOL into <BR>.
You can also do a change after the nth column into <BR>. Use a regular expression to do this. There are examples of this in this forum.
An automated tool could be PHP. Then you can read in the textfile, and after the nth position, put in the <BR>. Make it into a class and you can use it for every textfile. There are examples of this on the PHP website (www.php.net) and many others.
Regards,
Jan Paul