how to replace three spaces with tab
how to replace three spaces with tab
am 03.06.2005 00:11:59 von James Miller
Here's another example of what looks like something that should be fairly
straightforward but which I've been struggling with for at least an hour
and cannot find an answer. I ran into this before and was similarly
stumped, so I did it all manually. This time I just want to get it done
and finally find out the secret, my ignorance, or whether this really is
one of those irresolvable riddles of (Linux) life.
I have a document that consists of about 5,500 entries, each on its own
line. If this matters, it's a block file to block out advertising by
resolving certain domains to the localhost (127.0.0.1). In each line of
the file as I saved it, there are three space characters between the IP
and the domain name (damn that elinks browser for doing that!). For my
router to effectively use the file, each of those 5,500 three-space
sequences need to be changed to a tab sequence--like when you press the
tab key while typing in a document. How can I automate this?
I know how I'd do it in Word, but I've sworn off that sorry excuse for a
piece of software (those guys in Redmond will be jumping with glee when
they read this one: man with naive open source principles walks off Linux
precipice). None of the Linux equivalents I've tried (Abiword, OpenOffice,
gedit, nano) gives any indication of how a tab character can be inserted
in their search-and-replace feature. There are no formatting characters to
select, as they call them in smarmy M$ speak. The search-and-replace
dialogues all understand hitting the tab key as the user wanting to move
to the next field, not as data entry. There's probably a simple command
line way to do this, but if I were adept enough at simple command line
stuff, I'd have found it already. Can anyone offer pointers on how to
automate replacement of the 5,500 three-space sequences with a tab
sequence?
Thanks, James
------------------------------------------------------------ -------+
If you hit the "reply" button in your email client to respond to my
message, be sure to remove the REMOVETHIS portion of my email address
(inserted as an anti-spam tactic). If you don't, your message won't
reach me.
------------------------------------------------------------ -------+
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 03.06.2005 00:40:01 von Eric Bambach
sed 's/ /\t/' largefile.txt > largefile.edited
Notice that s/(Three spaces)/(special Tab character sequence)/
This will replace ALL occurances of 3 spaces in your file. Make sure yo=
u dont=20
have 3 spaces in any other context or those will be changed too. It wil=
l=20
output to a new file in case i didnt get it right ;)
On Thursday 02 June 2005 05:11 pm, James Miller wrote:
> Here's another example of what looks like something that should be fa=
irly
> straightforward but which I've been struggling with for at least an h=
our
> and cannot find an answer. I ran into this before and was similarly
> stumped, so I did it all manually. This time I just want to get it do=
ne
> and finally find out the secret, my ignorance, or whether this really=
is
> one of those irresolvable riddles of (Linux) life.
>
> I have a document that consists of about 5,500 entries, each on its o=
wn
> line. If this matters, it's a block file to block out advertising by
> resolving certain domains to the localhost (127.0.0.1). In each line =
of
> the file as I saved it, there are three space characters between the =
IP
> and the domain name (damn that elinks browser for doing that!). For m=
y
> router to effectively use the file, each of those 5,500 three-space
> sequences need to be changed to a tab sequence--like when you press t=
he
> tab key while typing in a document. How can I automate this?
>
> I know how I'd do it in Word, but I've sworn off that sorry excuse fo=
r a
> piece of software (those guys in Redmond will be jumping with glee wh=
en
> they read this one: man with naive open source principles walks off L=
inux
> precipice). None of the Linux equivalents I've tried (Abiword, OpenOf=
fice,
> gedit, nano) gives any indication of how a tab character can be inser=
ted
> in their search-and-replace feature. There are no formatting characte=
rs to
> select, as they call them in smarmy M$ speak. The search-and-replace
> dialogues all understand hitting the tab key as the user wanting to m=
ove
> to the next field, not as data entry. There's probably a simple comma=
nd
> line way to do this, but if I were adept enough at simple command lin=
e
> stuff, I'd have found it already. Can anyone offer pointers on how to
> automate replacement of the 5,500 three-space sequences with a tab
> sequence?
>
> Thanks, James
>
> ------------------------------------------------------------ -------+
> If you hit the "reply" button in your email client to respond to my
> message, be sure to remove the REMOVETHIS portion of my email address
> (inserted as an anti-spam tactic). If you don't, your message won't
> reach me.
> ------------------------------------------------------------ -------+
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbi=
e" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
--=20
----------------------------------------
--EB
> All is fine except that I can reliably "oops" it simply by trying to =
read
> from /proc/apm (e.g. cat /proc/apm).
> oops output and ksymoops-2.3.4 output is attached.
> Is there anything else I can contribute?
The latitude and longtitude of the bios writers current position, and
a ballistic missile.
--Alan Cox LKML-Decembe=
r 08,2000=20
----------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie"=
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 03.06.2005 01:35:07 von James Miller
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--8323328-1963722583-1117755307=:7223
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
On Thu, 2 Jun 2005, Eric Bambach wrote:
> sed 's/ /\t/' largefile.txt > largefile.edited
>
> Notice that s/(Three spaces)/(special Tab character sequence)/
>
> This will replace ALL occurances of 3 spaces in your file. Make sure you =
dont
> have 3 spaces in any other context or those will be changed too. It will
> output to a new file in case i didnt get it right ;)
Thanks for that command line tip, Eric. Meantime, I discovered that xedit=
=20
tells you, in it's search-and-replace routine, how to enter a tab=20
sequence: you hit ctrl-q and then tab while you're in the field where you=
=20
input the replacement text. This seems to have worked quite well. Why=20
xedit, of all editors, should have this feature? Dunno. Are there yet=20
other ways of doing this?
Thanks, James
>
> On Thursday 02 June 2005 05:11 pm, James Miller wrote:
>> Here's another example of what looks like something that should be fairl=
y
>> straightforward but which I've been struggling with for at least an hour
>> and cannot find an answer. I ran into this before and was similarly
>> stumped, so I did it all manually. This time I just want to get it done
>> and finally find out the secret, my ignorance, or whether this really is
>> one of those irresolvable riddles of (Linux) life.
>>
>> I have a document that consists of about 5,500 entries, each on its own
>> line. If this matters, it's a block file to block out advertising by
>> resolving certain domains to the localhost (127.0.0.1). In each line of
>> the file as I saved it, there are three space characters between the IP
>> and the domain name (damn that elinks browser for doing that!). For my
>> router to effectively use the file, each of those 5,500 three-space
>> sequences need to be changed to a tab sequence--like when you press the
>> tab key while typing in a document. How can I automate this?
>>
>> I know how I'd do it in Word, but I've sworn off that sorry excuse for a
>> piece of software (those guys in Redmond will be jumping with glee when
>> they read this one: man with naive open source principles walks off Linu=
x
>> precipice). None of the Linux equivalents I've tried (Abiword, OpenOffic=
e,
>> gedit, nano) gives any indication of how a tab character can be inserted
>> in their search-and-replace feature. There are no formatting characters =
to
>> select, as they call them in smarmy M$ speak. The search-and-replace
>> dialogues all understand hitting the tab key as the user wanting to move
>> to the next field, not as data entry. There's probably a simple command
>> line way to do this, but if I were adept enough at simple command line
>> stuff, I'd have found it already. Can anyone offer pointers on how to
>> automate replacement of the 5,500 three-space sequences with a tab
>> sequence?
>>
>> Thanks, James
>>
>> ------------------------------------------------------------ -------+
>> If you hit the "reply" button in your email client to respond to my
>> message, be sure to remove the REMOVETHIS portion of my email address
>> (inserted as an anti-spam tactic). If you don't, your message won't
>> reach me.
>> ------------------------------------------------------------ -------+
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-newbie" =
in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.linux-learn.org/faqs
>
> --=20
> ----------------------------------------
> --EB
>
>> All is fine except that I can reliably "oops" it simply by trying to rea=
d
>> from /proc/apm (e.g. cat /proc/apm).
>> oops output and ksymoops-2.3.4 output is attached.
>> Is there anything else I can contribute?
>
> The latitude and longtitude of the bios writers current position, and
> a ballistic missile.
>
> --Alan Cox LKML-December =
08,2000
>
> ----------------------------------------
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" i=
n
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
------------------------------------------------------------ -------+
If you hit the "reply" button in your email client to respond to my=20
message, be sure to remove the REMOVETHIS portion of my email address=20
(inserted as an anti-spam tactic). If you don't, your message won't=20
reach me.
------------------------------------------------------------ -------+
--8323328-1963722583-1117755307=:7223--
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 03.06.2005 02:07:06 von Eric Bambach
On Thursday 02 June 2005 06:35 pm, James Miller wrote:
> On Thu, 2 Jun 2005, Eric Bambach wrote:
> > sed 's/ /\t/' largefile.txt > largefile.edited
> >
> > Notice that s/(Three spaces)/(special Tab character sequence)/
> >
> > This will replace ALL occurances of 3 spaces in your file. Make sur=
e you
> > dont have 3 spaces in any other context or those will be changed to=
o. It
> > will output to a new file in case i didnt get it right ;)
>
> Thanks for that command line tip, Eric. Meantime, I discovered that x=
edit
> tells you, in it's search-and-replace routine, how to enter a tab
> sequence: you hit ctrl-q and then tab while you're in the field where=
you
> input the replacement text. This seems to have worked quite well. Why
> xedit, of all editors, should have this feature? Dunno. Are there yet
> other ways of doing this?
>
Well the way I said was one of easiest off the top of my head. I suppos=
e=20
search and replace features would have to be on an editor by editor bas=
is.
There are plenty of ways to do everything in linux. Im sure someone cou=
ld come=20
up with a perl one or two liner for that. A search-and-replace in an ed=
itor=20
like you said. Im sure there are a few more command line tools that wou=
ld=20
work too. tr? I think that only does single characters though. Anything=
=20
command-line related that doesnt use sed escapes me for right now thoug=
h.
> Thanks, James
>
> > On Thursday 02 June 2005 05:11 pm, James Miller wrote:
> >> Here's another example of what looks like something that should be
> >> fairly straightforward but which I've been struggling with for at =
least
> >> an hour and cannot find an answer. I ran into this before and was
> >> similarly stumped, so I did it all manually. This time I just want=
to
> >> get it done and finally find out the secret, my ignorance, or whet=
her
> >> this really is one of those irresolvable riddles of (Linux) life.
> >>
> >> I have a document that consists of about 5,500 entries, each on it=
s own
> >> line. If this matters, it's a block file to block out advertising =
by
> >> resolving certain domains to the localhost (127.0.0.1). In each li=
ne of
> >> the file as I saved it, there are three space characters between t=
he IP
> >> and the domain name (damn that elinks browser for doing that!). Fo=
r my
> >> router to effectively use the file, each of those 5,500 three-spac=
e
> >> sequences need to be changed to a tab sequence--like when you pres=
s the
> >> tab key while typing in a document. How can I automate this?
> >>
> >> I know how I'd do it in Word, but I've sworn off that sorry excuse=
for a
> >> piece of software (those guys in Redmond will be jumping with glee=
when
> >> they read this one: man with naive open source principles walks of=
f
> >> Linux precipice). None of the Linux equivalents I've tried (Abiwor=
d,
> >> OpenOffice, gedit, nano) gives any indication of how a tab charact=
er can
> >> be inserted in their search-and-replace feature. There are no form=
atting
> >> characters to select, as they call them in smarmy M$ speak. The
> >> search-and-replace dialogues all understand hitting the tab key as=
the
> >> user wanting to move to the next field, not as data entry. There's
> >> probably a simple command line way to do this, but if I were adept
> >> enough at simple command line stuff, I'd have found it already. Ca=
n
> >> anyone offer pointers on how to automate replacement of the 5,500
> >> three-space sequences with a tab sequence?
> >>
> >> Thanks, James
> >>
> >> ------------------------------------------------------------ ------=
-+
> >> If you hit the "reply" button in your email client to respond to m=
y
> >> message, be sure to remove the REMOVETHIS portion of my email addr=
ess
> >> (inserted as an anti-spam tactic). If you don't, your message won'=
t
> >> reach me.
> >> ------------------------------------------------------------ ------=
-+
> >> -
> >> To unsubscribe from this list: send the line "unsubscribe linux-ne=
wbie"
> >> in the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> Please read the FAQ at http://www.linux-learn.org/faqs
> >
> > --
> > ----------------------------------------
> > --EB
> >
> >> All is fine except that I can reliably "oops" it simply by trying =
to
> >> read from /proc/apm (e.g. cat /proc/apm).
> >> oops output and ksymoops-2.3.4 output is attached.
> >> Is there anything else I can contribute?
> >
> > The latitude and longtitude of the bios writers current position, a=
nd
> > a ballistic missile.
> >
> > --Alan Cox LKML-Dec=
ember 08,2000
> >
> > ----------------------------------------
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-new=
bie"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.linux-learn.org/faqs
>
> ------------------------------------------------------------ -------+
> If you hit the "reply" button in your email client to respond to my
> message, be sure to remove the REMOVETHIS portion of my email address
> (inserted as an anti-spam tactic). If you don't, your message won't
> reach me.
> ------------------------------------------------------------ -------+
--=20
----------------------------------------
--EB
> All is fine except that I can reliably "oops" it simply by trying to =
read
> from /proc/apm (e.g. cat /proc/apm).
> oops output and ksymoops-2.3.4 output is attached.
> Is there anything else I can contribute?
The latitude and longtitude of the bios writers current position, and
a ballistic missile.
--Alan Cox LKML-Decembe=
r 08,2000=20
----------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie"=
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 03.06.2005 12:08:26 von mailing-lists
On Thu, 2 Jun 2005, Eric Bambach wrote:
> On Thursday 02 June 2005 06:35 pm, James Miller wrote:
> > On Thu, 2 Jun 2005, Eric Bambach wrote:
> > > sed 's/ /\t/' largefile.txt > largefile.edited
> > >
> > > Notice that s/(Three spaces)/(special Tab character sequence)/
> > >
> > > This will replace ALL occurances of 3 spaces in your file. Make sure you
> > > dont have 3 spaces in any other context or those will be changed too. It
> > > will output to a new file in case i didnt get it right ;)
> >
> > Thanks for that command line tip, Eric. Meantime, I discovered that xedit
> > tells you, in it's search-and-replace routine, how to enter a tab
> > sequence: you hit ctrl-q and then tab while you're in the field where you
> > input the replacement text. This seems to have worked quite well. Why
> > xedit, of all editors, should have this feature? Dunno. Are there yet
> > other ways of doing this?
> >
>
> Well the way I said was one of easiest off the top of my head. I suppose
> search and replace features would have to be on an editor by editor basis.
>
> There are plenty of ways to do everything in linux. Im sure someone could come
> up with a perl one or two liner for that. A search-and-replace in an editor
> like you said. Im sure there are a few more command line tools that would
> work too. tr?
`tr' can squeeze repeats.. For example:
~: tr -s ' ' ' ' < foo.txt
Will remove multiple blank spaces and leave one.. Another one..
~: tr -cs '[A-Z][a-z]' '[\n*]'
Will remove multiple '\012' newlines
> I think that only does single characters though. Anything
> command-line related that doesnt use sed escapes me for right now though.
If you want pattern scanning in text processing awk & sed are the way to
go. If your not fluent in sed at the command-line look for a document on
the internet [www.google.com/linux] called:
HANDY ONE-LINERS FOR SED (Unix stream editor) compiled by Eric Pement
The website IBM developer works also holds resources and online course
regarding pattern scanning and text processing on the CLI.
Heiners shelldorado also houses many scripts and one-liners
And of course the LDP [Linux Documentation Project]
In this particular case I personally would prefer `awk'. Awk works with
fields [records]. It is designed for this stuff.. And it has a printf
statement.
~: awk '{print $1, $2} foo.txt
match an expression only on field 3
~: awk '$3 ~ /[Ee]pression/ { print }' foo.txt
As you can see awk works natively with records..
Next time maybe add some fields or records from your text file. That way
people can give you clear pointers, suggestions - solutions...
Text processing and pattern scanning are prob. one of the oldest tasks
in the Unix/Linux world. Building filters on the command-line the ``Unix
philosophy``, do one thing - and do it good.. That's definitly the way..
Greetzz.
J.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 04.06.2005 07:11:00 von Franklin Chua
I don't know if this will work for you
unexpand -all -tabs=3 file1 > file2
or
unexpand -a -t=3 file1 > file2
:-)
Eric Bambach wrote:
>On Thursday 02 June 2005 06:35 pm, James Miller wrote:
>
>
>>On Thu, 2 Jun 2005, Eric Bambach wrote:
>>
>>
>>>sed 's/ /\t/' largefile.txt > largefile.edited
>>>
>>>Notice that s/(Three spaces)/(special Tab character sequence)/
>>>
>>>This will replace ALL occurances of 3 spaces in your file. Make sure you
>>>dont have 3 spaces in any other context or those will be changed too. It
>>>will output to a new file in case i didnt get it right ;)
>>>
>>>
>>Thanks for that command line tip, Eric. Meantime, I discovered that xedit
>>tells you, in it's search-and-replace routine, how to enter a tab
>>sequence: you hit ctrl-q and then tab while you're in the field where you
>>input the replacement text. This seems to have worked quite well. Why
>>xedit, of all editors, should have this feature? Dunno. Are there yet
>>other ways of doing this?
>>
>>
>>
>
>Well the way I said was one of easiest off the top of my head. I suppose
>search and replace features would have to be on an editor by editor basis.
>
>There are plenty of ways to do everything in linux. Im sure someone could come
>up with a perl one or two liner for that. A search-and-replace in an editor
>like you said. Im sure there are a few more command line tools that would
>work too. tr? I think that only does single characters though. Anything
>command-line related that doesnt use sed escapes me for right now though.
>
>
>
>
>>Thanks, James
>>
>>
>>
>>>On Thursday 02 June 2005 05:11 pm, James Miller wrote:
>>>
>>>
>>>>Here's another example of what looks like something that should be
>>>>fairly straightforward but which I've been struggling with for at least
>>>>an hour and cannot find an answer. I ran into this before and was
>>>>similarly stumped, so I did it all manually. This time I just want to
>>>>get it done and finally find out the secret, my ignorance, or whether
>>>>this really is one of those irresolvable riddles of (Linux) life.
>>>>
>>>>I have a document that consists of about 5,500 entries, each on its own
>>>>line. If this matters, it's a block file to block out advertising by
>>>>resolving certain domains to the localhost (127.0.0.1). In each line of
>>>>the file as I saved it, there are three space characters between the IP
>>>>and the domain name (damn that elinks browser for doing that!). For my
>>>>router to effectively use the file, each of those 5,500 three-space
>>>>sequences need to be changed to a tab sequence--like when you press the
>>>>tab key while typing in a document. How can I automate this?
>>>>
>>>>I know how I'd do it in Word, but I've sworn off that sorry excuse for a
>>>>piece of software (those guys in Redmond will be jumping with glee when
>>>>they read this one: man with naive open source principles walks off
>>>>Linux precipice). None of the Linux equivalents I've tried (Abiword,
>>>>OpenOffice, gedit, nano) gives any indication of how a tab character can
>>>>be inserted in their search-and-replace feature. There are no formatting
>>>>characters to select, as they call them in smarmy M$ speak. The
>>>>search-and-replace dialogues all understand hitting the tab key as the
>>>>user wanting to move to the next field, not as data entry. There's
>>>>probably a simple command line way to do this, but if I were adept
>>>>enough at simple command line stuff, I'd have found it already. Can
>>>>anyone offer pointers on how to automate replacement of the 5,500
>>>>three-space sequences with a tab sequence?
>>>>
>>>>Thanks, James
>>>>
>>>>-------------------------------------------------------- -----------+
>>>>If you hit the "reply" button in your email client to respond to my
>>>>message, be sure to remove the REMOVETHIS portion of my email address
>>>>(inserted as an anti-spam tactic). If you don't, your message won't
>>>>reach me.
>>>>-------------------------------------------------------- -----------+
>>>>-
>>>>To unsubscribe from this list: send the line "unsubscribe linux-newbie"
>>>>in the body of a message to majordomo@vger.kernel.org
>>>>More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>Please read the FAQ at http://www.linux-learn.org/faqs
>>>>
>>>>
>>>--
>>>----------------------------------------
>>>--EB
>>>
>>>
>>>
>>>>All is fine except that I can reliably "oops" it simply by trying to
>>>>read from /proc/apm (e.g. cat /proc/apm).
>>>>oops output and ksymoops-2.3.4 output is attached.
>>>>Is there anything else I can contribute?
>>>>
>>>>
>>>The latitude and longtitude of the bios writers current position, and
>>>a ballistic missile.
>>>
>>> --Alan Cox LKML-December 08,2000
>>>
>>>----------------------------------------
>>>-
>>>To unsubscribe from this list: send the line "unsubscribe linux-newbie"
>>>in the body of a message to majordomo@vger.kernel.org
>>>More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>Please read the FAQ at http://www.linux-learn.org/faqs
>>>
>>>
>>---------------------------------------------------------- ---------+
>>If you hit the "reply" button in your email client to respond to my
>>message, be sure to remove the REMOVETHIS portion of my email address
>>(inserted as an anti-spam tactic). If you don't, your message won't
>>reach me.
>>---------------------------------------------------------- ---------+
>>
>>
>
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 04.06.2005 08:39:52 von mailing-lists
On Sat, 4 Jun 2005, Franklin Chua wrote:
> I don't know if this will work for you
>
> unexpand -all -tabs=3 file1 > file2
> or
> unexpand -a -t=3 file1 > file2
>
> :-)
Wow, nice one... ! lol.. Thnkx..
J.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 04.06.2005 13:05:30 von James Miller
On Sat, 4 Jun 2005, Franklin Chua wrote:
> I don't know if this will work for you
>
> unexpand -all -tabs=3 file1 > file2
> or
> unexpand -a -t=3 file1 > file2
me@mymachine:~$ unexpand -a -t=3 tmp-test_unexpand > file2
unexpand: tab size contains an invalid character
me@mymachine:~$ unexpand -a -t=3 tmp-test_unexpand >file2
unexpand: tab size contains an invalid character
me@mymachine:~$ unexpand -all -tabs=3 tmp-test_unexpand > file2
unexpand: invalid option -- l
Try `unexpand --help' for more information.
me@mymachine:~$
James
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: how to replace three spaces with tab
am 04.06.2005 14:13:49 von zavandi
James Miller wrote:
>
> me@mymachine:~$ unexpand -a -t=3 tmp-test_unexpand > file2
> unexpand: tab size contains an invalid character
> me@mymachine:~$ unexpand -a -t=3 tmp-test_unexpand >file2
> unexpand: tab size contains an invalid character
> me@mymachine:~$ unexpand -all -tabs=3 tmp-test_unexpand > file2
> unexpand: invalid option -- l
> Try `unexpand --help' for more information.
> me@mymachine:~$
unexpand -a -t3 tmp-test_unexpand > file2
....or...
unexpand -a -t 3 tmp-test_unexpand > file2
....or...
unexpand --all --tabs=3 tmp-test_unexpand > file2
....or...
unexpand --all --tabs 3 tmp-test_unexpand > file2
It's all standard getopt_long(3) usage.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs