public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Paul McFerrin <pmcferrin@columbus.rr.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Cc: 'Ralf Gans' <Ralf.Gans@NSG-GmbH.de>
Subject: RE: Copy converts tabs to spaces ?
Date: Sat, 07 Feb 2009 17:24:00 -0000	[thread overview]
Message-ID: <498DC3D6.1040906@columbus.rr.com> (raw)
In-Reply-To: <B7021E1A-156E-4F9B-ADFC-B6DE58D5E14D@NSG-GmbH.de>

>>> On 02.02.2009, at 11:05, xerces8 wrote:
>>>> I noticed that when copying text from a the Cygwin Bash window and
>>>> then pasting it somewhere (like WordPad), tabulator characters are
>>>> converted to spaces. 
>>>> 
>>>> The same happens with RXVT too.
>>>> 
>>>> Details:
>>>> - print the content of some text file that has tabs (like a C
>>>> program source) : cat foo.c 
>>>> - select and copy the text with the mouse
>>>> - paste (ctrl-V) into WordPad
>>>> 
>>>> The text in Wordpad has no more tabs.
>>>> 
>>>> Is there a way around this ?
>>> 
>>> copy an paste from window to window takes what's printed, not what
>>> you have written. 
>>> 
>>> So, if the terminal prints spaces to represent the tabs, as a
>>> terminal usually does, you CAN only copy spaces.

Let me add my 2 cents worth.  If you have the "newform" command, the 
following magic will work:

	$ newform -i-8 -o0 input_file >output_file

I have newform but i'm not sure where i got it since I was a long-time 
AT&T Unix user.  I also didn't find a man page.  It's a very handy tool.

Translations:
	-i-8 = input tabs assumed to be at every 8 columns
	-o0 = output has tabs at 0 (no tabs)

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  parent reply	other threads:[~2009-02-07 17:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 10:06 xerces8
2009-02-02 10:27 ` Sisyphus
2009-02-02 10:42   ` Sisyphus
2009-02-02 13:57 ` Ralf Gans
2009-02-02 20:16   ` Buchbinder, Barry (NIH/NIAID) [E]
     [not found]     ` <B7021E1A-156E-4F9B-ADFC-B6DE58D5E14D@NSG-GmbH.de>
2009-02-07 13:25       ` Buchbinder, Barry (NIH/NIAID) [E]
2009-02-07 17:24       ` Paul McFerrin [this message]
2009-02-08 16:30         ` tmcd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=498DC3D6.1040906@columbus.rr.com \
    --to=pmcferrin@columbus.rr.com \
    --cc=Ralf.Gans@NSG-GmbH.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).