On Mon, Apr 16, 2007 at 04:36:51PM -0600, Eduardo Sanz Garcia wrote:
> Chris Carey wrote:
> > On 4/16/07, Eduardo Sanz Garcia <[EMAIL PROTECTED]> wrote:
> > > I have a file like this:
> > > [arbitrary number of spaces]/37/[arbitrary number of
> > > spaces]/100/[arbitrary number of spaces]/95/
> > >
Thank you very much.
The sed command works great.
The -i option is also great, thank you for the suggestions.
Lloyd Brown wrote:
>Try this:
>
>sed -e 's/ \+/\t/g'
>
>Now, normally, I'd use a "\s" to represent any form of whitespace, but for
>some reason, this wasn't working for me, so I just use
Try this:
sed -e 's/ \+/\t/g'
Now, normally, I'd use a "\s" to represent any form of whitespace, but for
some reason, this wasn't working for me, so I just used a single space.
Honestly, I *really* like regexes, but I use them either in a language
like Perl, or in an editor most often. Sed isn
On Monday 16 April 2007 04:07:50 pm Eduardo Sanz Garcia wrote:
> I have a file like this:
> [arbitrary number of spaces]/37/[arbitrary number of
> spaces]/100/[arbitrary number of spaces]/95/
>
> I want to convert each arbitrary number of spaces into one tab:
> [tab]/37/[tab]/100/[tab]/95/
>
> How
Could you give an example?
Chris Carey wrote:
>On 4/16/07, Eduardo Sanz Garcia <[EMAIL PROTECTED]> wrote:
>
>
>>I have a file like this:
>>[arbitrary number of spaces]/37/[arbitrary number of
>>spaces]/100/[arbitrary number of spaces]/95/
>>
>>I want to convert each arbitrary number of spaces i
On 4/16/07, Eduardo Sanz Garcia <[EMAIL PROTECTED]> wrote:
> I have a file like this:
> [arbitrary number of spaces]/37/[arbitrary number of
> spaces]/100/[arbitrary number of spaces]/95/
>
> I want to convert each arbitrary number of spaces into one tab:
> [tab]/37/[tab]/100/[tab]/95/
>
> How can
I have a file like this:
[arbitrary number of spaces]/37/[arbitrary number of
spaces]/100/[arbitrary number of spaces]/95/
I want to convert each arbitrary number of spaces into one tab:
[tab]/37/[tab]/100/[tab]/95/
How can I do this with sed?
Thank you.
BYU Unix Users Group
Users Group
Sent: Monday, March 12, 2007 8:03:35 PM
Subject: Re: [uug] sed question
I found the reply to my own question:
echo "akd_fak_asdkf_jal" | sed -e "s/\(_.*\)//" ===> akd
Eduardo Sanz Garcia wrote:
>Now the *oposite* question:
>If I have a line like this &q
I found the reply to my own question:
echo "akd_fak_asdkf_jal" | sed -e "s/\(_.*\)//" ===> akd
Eduardo Sanz Garcia wrote:
>Now the *oposite* question:
>If I have a line like this "akd_fak_asdkf_jal" and I want the leading "akd"
>How can I do this using sed or other utilities?
>
>
>Eduardo Sa
Now the *oposite* question:
If I have a line like this "akd_fak_asdkf_jal" and I want the leading "akd"
How can I do this using sed or other utilities?
Eduardo Sanz García wrote:
>A sed question:
>I have a line like this "akd_fak_asdkf_jal" and I want the trailing
>"_jal".
>How can I do this u
IL PROTECTED]>
To: uug-list@uug.byu.edu; uug-list@phantom.byu.edu
Sent: Saturday, March 10, 2007 6:24:35 PM
Subject: Re: [uug] sed question
* Michael Brailsford [Sat, 10 Mar 2007 at 11:25 -0800]
> I would use awk (or any of its various forms, such as gawk) for that.
>
> echo akd_fak_asdkf
Blasted! Why does that always happen to me?
signature.asc
Description: Digital signature
BYU Unix Users Group
http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
* Michael Brailsford [Sat, 10 Mar 2007 at 11:25 -0800]
> I would use awk (or any of its various forms, such as gawk) for that.
>
> echo akd_fak_asdkf_jal | gawk -F_ '{print "_" $4}'
>
> Or even cut (though you will lose the char used as the delim):
>
> echo akd_fak_asdkf_jal | cut -f4 -d_
What
ia <[EMAIL PROTECTED]>
To: BYU Unix Users Group
Sent: Friday, March 9, 2007 6:54:06 PM
Subject: Re: [uug] sed question
Thank you Joshua.
It works well.
The command was not simple. It seems that you know a lot about regular
expression.
How did you learn regular expression and/
The way I learned was by finding a tutorial on-line and then
practicing to get the feel of it.
Joshua Draper
On Mar 9, 2007, at 5:54 PM, Eduardo Sanz-Garcia wrote:
>
>Thank you Joshua.
>It works well.
>The command was not simple. It seems that you know a lot about
> regular
>
Eduardo Sanz-Garcia wrote:
>Thank you Joshua.
>It works well.
>The command was not simple. It seems that you know a lot about regular
>expression.
>How did you learn regular expression and/or sed? Any suggested book?
>
>
O'Reilly has a book called, Mastering Regular Expressio
Thank you Joshua.
It works well.
The command was not simple. It seems that you know a lot about regular
expression.
How did you learn regular expression and/or sed? Any suggested book?
Joshua Draper wrote:
If you know want the text "_jal", you can use line below. I saved
your
If you know want the text "_jal", you can use line below. I saved
your text string in a file called testsed.
$ sed -e "s/.*\(_jal\)/\1/" testsed
If you want the "_jal" because it is the last group of letters, then
you could use the following line.
$ sed -e "s/.*\(_.*\)/\1/" testsed
both co
A sed question:
I have a line like this "akd_fak_asdkf_jal" and I want the trailing
"_jal".
How can I do this using sed or other utilities?
Thank you.
BYU Unix Users Group
http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author.
On Tue, Dec 16, 2003 at 07:54:59PM -0700, Tony Vance wrote:
>
> Hey everyone,
>
> I have a sed question. I want to add more specific user information to the
> /etc/passwd file using a shell script. I'm thinking of something like the following
> to edit /etc/passwd's last line:
>
> echo Plea
Hey everyone,
I have a sed question. I want to add more specific user information to the
/etc/passwd file using a shell script. I'm thinking of something like the following
to edit /etc/passwd's last line:
echo Please enter the user's full name:
read fullname
sed -i '$s/::/:$fullname:/' /et
21 matches
Mail list logo