Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Saving text files with Textedit

 
   Mac (Home) -> Mac General RSS
Next:  Replacing iBook G4 LCD backlight, keeping the LCD  
Author Message
John Stolz

External


Since: Sep 06, 2005
Posts: 121



(Msg. 1) Posted: Fri Aug 10, 2007 8:35 am
Post subject: Saving text files with Textedit
Archived from groups: comp>sys>mac>misc (more info?)

How do I save a file with textedit so I can use it in terminal.
I've tried various plain text encoding options, but the files end up
being either binary or, when I do 'cat' on them, the line breaks are
replaced by '^M' and the file appears to be one line.
Needless to say 'grep' doesn't work properly.
Back to top
Login to vote
The Natural Philosopher

External


Since: Jun 25, 2007
Posts: 73



(Msg. 2) Posted: Fri Aug 10, 2007 10:15 am
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John Stolz wrote:
> How do I save a file with textedit so I can use it in terminal.
> I've tried various plain text encoding options, but the files end up
> being either binary or, when I do 'cat' on them, the line breaks are
> replaced by '^M' and the file appears to be one line.
> Needless to say 'grep' doesn't work properly.

I found using the 'change to plain text' command worked under the format
menu.

Also its worth making the default not RTF.
Back to top
Login to vote
John Stolz

External


Since: Sep 06, 2005
Posts: 121



(Msg. 3) Posted: Fri Aug 10, 2007 3:18 pm
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The Natural Philosopher wrote:
> John Stolz wrote:
>> How do I save a file with textedit so I can use it in terminal.
>> I've tried various plain text encoding options, but the files end up
>> being either binary or, when I do 'cat' on them, the line breaks are
>> replaced by '^M' and the file appears to be one line.
>> Needless to say 'grep' doesn't work properly.
>
> I found using the 'change to plain text' command worked under the format
> menu.
>
> Also its worth making the default not RTF.
Hmm, I guess it depends on the type of source file. I have a file which
looks fine in textedit, but when I do a 'cat' I only get partial
(random) output, some text even appears below the cursor line in
Terminal. Clearly there are some kind of cursor control charachter in
the file.
I wondered if there is a utility to turn a Textedit 'text' file into a
true textfile
Back to top
Login to vote
David Lesher

External


Since: Jun 11, 2006
Posts: 28



(Msg. 4) Posted: Fri Aug 10, 2007 3:52 pm
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John Stolz <china_rider DeleteThis @wanadoo.fr> writes:

>I wondered if there is a utility to turn a Textedit 'text' file into a
>true textfile

Like BBedit?
--
A host is a host from coast to coast.................wb8foz DeleteThis @nrk.com
& no one will talk to a host that's close........[v].(301) 56-LINUX
Unless the host (that isn't close).........................pob 1433
is busy, hung or dead....................................20915-1433
Back to top
Login to vote
Dave Balderstone

External


Since: May 31, 2006
Posts: 850



(Msg. 5) Posted: Fri Aug 10, 2007 3:52 pm
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <f9i1j8$m9i$1@reader2.panix.com>, David Lesher
<wb8foz RemoveThis @panix.com> wrote:

> John Stolz <china_rider RemoveThis @wanadoo.fr> writes:
>
> >I wondered if there is a utility to turn a Textedit 'text' file into a
> >true textfile
>
> Like BBedit?

Or the free version, TextWrangler.
Back to top
Login to vote
The Natural Philosopher

External


Since: Jun 25, 2007
Posts: 73



(Msg. 6) Posted: Fri Aug 10, 2007 7:16 pm
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John Stolz wrote:
> The Natural Philosopher wrote:
>> John Stolz wrote:
>>> How do I save a file with textedit so I can use it in terminal.
>>> I've tried various plain text encoding options, but the files end up
>>> being either binary or, when I do 'cat' on them, the line breaks are
>>> replaced by '^M' and the file appears to be one line.
>>> Needless to say 'grep' doesn't work properly.
>>
>> I found using the 'change to plain text' command worked under the
>> format menu.
>>
>> Also its worth making the default not RTF.
> Hmm, I guess it depends on the type of source file. I have a file which
> looks fine in textedit, but when I do a 'cat' I only get partial
> (random) output, some text even appears below the cursor line in
> Terminal. Clearly there are some kind of cursor control charachter in
> the file.
> I wondered if there is a utility to turn a Textedit 'text' file into a
> true textfile

yep. Convert to pure text.
Back to top
Login to vote
David Empson

External


Since: Nov 30, 2005
Posts: 257



(Msg. 7) Posted: Sat Aug 11, 2007 11:32 am
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John Stolz <china_rider.RemoveThis@wanadoo.fr> wrote:

> How do I save a file with textedit so I can use it in terminal.

Easiest option in this situation is not to use TextEdit. Use the free
TextWrangler (from Bare Bones) instead, or BBEdit, its commercial big
brother.

If you need to use TextEdit, then read on...

The Unix command line tools in Terminal mostly deal with ASCII text
files. You should use TextEdit's "Make Plain Text" command, choose to
save the file in an encoding format which is as close to ASCII as
possible, and avoid the use of non-English characters.

The best encoding format to pick is probably of the normally hidden
ones, such as "Western (ASCII)", which can be enabled if you use the
"Customize Encodings List" item in the encoding popup menu.

The default "Unicode (UTF-Cool" encoding should also work as long as you
avoid accents and symbols which require the use of the Option key with a
US keyboard.

Terminal can display non-ASCII characters (it defaults to UTF-Cool but
most of the command line tools won't handle UTF-8 sequences which
represent characters outside the basic character set.

> I've tried various plain text encoding options, but the files end up
> being either binary or, when I do 'cat' on them, the line breaks are
> replaced by '^M' and the file appears to be one line.

Binary might appear if you start to dabble with non-Western-European
languages, or pick "Unicode (UTF-16)".

I don't know how you got '^M'. That is the representation of a
Control-M, or Carriage Return (CR for short), which is the traditional
Macintosh line break character in text files, used by Mac OS 9 and
earlier. Was this an old file you were modifying in TextEdit?

For newly created text files, TextEdit uses ^J (Line Feed, LF for short)
as the line break character. This matches what the Unix tools in
Terminal expect, and is the standard for Mac OS X.

To confuse things further, there is a third standard: MS-DOS and Windows
use both CR and LF as a pair.

This typically means a conversion is required when copying text files
between systems, unless you are displaying the file in an application
which can automatically convert the line endings if it finds the wrong
type.

Some editors (notably BBEdit and its free sibling TextWrangler) have a
setting which lets you set the type of line break to use (Mac, Unix or
MS-DOS). I can't see any way to do that in TextEdit.

TextEdit can open files with varying line endings, and displays a line
break for any of CR, LF, or CR followed immediately by LF. Any editing
changes are done using the Unix/Mac OS X standard, with just a LF for
the line break when the document is saved. This can be confusing, as you
end up with a file with mixed line break standards, which most software
won't handle correctly.

Unix tools in Terminal will display CR as "go back to the start of the
current line", so a Mac OS 9 text file will be displayed with every line
overwritten by the next one. An MS-DOS/Windows file (CR and LF) will
look right, as the CR and LF as a pair have the same effect as LF by
itself.
--
David Empson
dempson.RemoveThis@actrix.gen.nz
Back to top
Login to vote
John Stolz

External


Since: Sep 06, 2005
Posts: 121



(Msg. 8) Posted: Sat Aug 11, 2007 2:10 pm
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The Natural Philosopher wrote:
> John Stolz wrote:
>> The Natural Philosopher wrote:
>>> John Stolz wrote:
>>>> How do I save a file with textedit so I can use it in terminal.
>>>> I've tried various plain text encoding options, but the files end up
>>>> being either binary or, when I do 'cat' on them, the line breaks are
>>>> replaced by '^M' and the file appears to be one line.
>>>> Needless to say 'grep' doesn't work properly.
>>>
>>> I found using the 'change to plain text' command worked under the
>>> format menu.
>>>
>>> Also its worth making the default not RTF.
>> Hmm, I guess it depends on the type of source file. I have a file
>> which looks fine in textedit, but when I do a 'cat' I only get partial
>> (random) output, some text even appears below the cursor line in
>> Terminal. Clearly there are some kind of cursor control charachter in
>> the file.
>> I wondered if there is a utility to turn a Textedit 'text' file into a
>> true textfile
>
> yep. Convert to pure text.
But the resulting file still has binary or cursor control character
(depending on the text encoding)
Back to top
Login to vote
John Stolz

External


Since: Sep 06, 2005
Posts: 121



(Msg. 9) Posted: Sat Aug 11, 2007 2:11 pm
Post subject: Re: Saving text files with Textedit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

David Empson wrote:
> John Stolz <china_rider.DeleteThis@wanadoo.fr> wrote:
>
>> How do I save a file with textedit so I can use it in terminal.
>
> Easiest option in this situation is not to use TextEdit. Use the free
> TextWrangler (from Bare Bones) instead, or BBEdit, its commercial big
> brother.
>
> If you need to use TextEdit, then read on...
>
> The Unix command line tools in Terminal mostly deal with ASCII text
> files. You should use TextEdit's "Make Plain Text" command, choose to
> save the file in an encoding format which is as close to ASCII as
> possible, and avoid the use of non-English characters.
>
> The best encoding format to pick is probably of the normally hidden
> ones, such as "Western (ASCII)", which can be enabled if you use the
> "Customize Encodings List" item in the encoding popup menu.
>
> The default "Unicode (UTF-Cool" encoding should also work as long as you
> avoid accents and symbols which require the use of the Option key with a
> US keyboard.
>
> Terminal can display non-ASCII characters (it defaults to UTF-Cool but
> most of the command line tools won't handle UTF-8 sequences which
> represent characters outside the basic character set.
>
>> I've tried various plain text encoding options, but the files end up
>> being either binary or, when I do 'cat' on them, the line breaks are
>> replaced by '^M' and the file appears to be one line.
>
> Binary might appear if you start to dabble with non-Western-European
> languages, or pick "Unicode (UTF-16)".
>
> I don't know how you got '^M'. That is the representation of a
> Control-M, or Carriage Return (CR for short), which is the traditional
> Macintosh line break character in text files, used by Mac OS 9 and
> earlier. Was this an old file you were modifying in TextEdit?
>
> For newly created text files, TextEdit uses ^J (Line Feed, LF for short)
> as the line break character. This matches what the Unix tools in
> Terminal expect, and is the standard for Mac OS X.
>
> To confuse things further, there is a third standard: MS-DOS and Windows
> use both CR and LF as a pair.
>
> This typically means a conversion is required when copying text files
> between systems, unless you are displaying the file in an application
> which can automatically convert the line endings if it finds the wrong
> type.
>
> Some editors (notably BBEdit and its free sibling TextWrangler) have a
> setting which lets you set the type of line break to use (Mac, Unix or
> MS-DOS). I can't see any way to do that in TextEdit.
>
> TextEdit can open files with varying line endings, and displays a line
> break for any of CR, LF, or CR followed immediately by LF. Any editing
> changes are done using the Unix/Mac OS X standard, with just a LF for
> the line break when the document is saved. This can be confusing, as you
> end up with a file with mixed line break standards, which most software
> won't handle correctly.
>
> Unix tools in Terminal will display CR as "go back to the start of the
> current line", so a Mac OS 9 text file will be displayed with every line
> overwritten by the next one. An MS-DOS/Windows file (CR and LF) will
> look right, as the CR and LF as a pair have the same effect as LF by
> itself.
Thanks, I'll give text wrangler a try.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
IPFW not saving settings on a reboot? - I have a G4 os 10.4, which I only use 'remotely' (no monitor or keyboard or mouse). I have VNC and ssh installed / enabled. When I reboot, my IPFW settings (port 25, 110, and 5903 (SMTP/POP/VNC) are gone. I need to ipfw add those settings back in. If I...

Name of a time-saving application required - I previously had installed an application on my Mac that when you typed a certain character sequence replaced it with difference characters (worked anywhere where this was typed). I have had to erase my hard drive and reinstall everything, but I forgot....

Cutting from a large text document - I find it hard to scroll up or down when I am cutting more than a page in a Mac document. As soon as I get to the edge of the page, it skips real fast, but I only want a few more lines. Is there a technique I can use to scroll up those few more lines....

PDF Files - Is there any way I can join 2 pdf files to create 1 file?

mkv files - Hi! Can I open a .mkv file on mac osX ?
       Mac (Home) -> Mac General All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact