[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regex search and replace
From: |
Gary Wessle |
Subject: |
Re: regex search and replace |
Date: |
23 Oct 2006 07:45:36 +1000 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Gary Wessle <phddas@yahoo.com> writes:
> Hi
>
> I am using GNU emacs 21.4.1 and wanting to use regex to do the
> following.
>
> I have few lines in the format
> -rw-r--r-- 1 fred fred 56823 Oct 14 01:32 samcar
> ...
> -rw-r--r-- 1 fred fred 56823 Oct 14 01:32 manham
>
> I want to end up with
> { "sam/car", ..., "man/ham" }
>
> so my step by step approach is to remove the
> " -rw-r--r-- 1 fred fred 56823 Oct 14 01:32 "
>
> then to change aaabbb with aaa/bbb.
>
> then to replace end of line with (", ")
>
> and maybe by then I will learn enough to finish the task.
>
> so, playing around with incremental regex search and hoping some body
> will help me to learn something mean while.
>
> thanks
I was able to reach
xxx/yyy
.../...
ass/bbb
but when I replace end-of-line with (", ") it still leaves an
end-of-line after (", ").
that is it does not convert the lines to one lone line in the form
xxx/yyy, ...,"aaa/bbb"
the command I used was
replace-regex<ret>$<ret>", "<ret>
thanks