From: Tim Chase <[EMAIL PROTECTED]>
Subject: Re: Vertical regexp
Date: Sat, 17 Feb 2007 09:11:36 -0600
> > Is there any way to find two specific items of an ascii table of the
> > same column but of two adjacent rows ?
>
> I'm not quite sure what you're trying to do on the data you
> described in your 2nd posting, so I'm divining intent as well as
> a solution. Perhaps with your intent as well, a better solution
> can be found.
>
> In the past, I've done things like
>
> /^\%(.\{25}\)\(.\).*\n\%(.\{25}\)\1
>
> to find places where character 26 on one line is the same as
> character 26 on the next line. Or, I've used
>
> /^\(\w\+\).*\n\1
>
> to find lines that begin with the same word. If you're looking
> for different characters ("A" and "Z") at a particular offset
> (26), you can use
>
> /^\%(.\{25}\)A.*\n\%(.\{25}\)Z
>
> It does require that you know the offset though.
>
> If your lines are fixed length (which it sounds like they might
> not be, as they have file-names which can be arbitrary lengths),
> you might be able to do something like
>
> /^.\{-}A\_.\{129}Z
>
> assuming there are 128 characters in each of your lines (the
> 129th is the \n character). If you right-padded your file so
> that it had a consistent length in each line, this solution might
> work for you.
>
> Just a few ideas that have worked for me in the past, doing
> something somewhat like I understand you to be describing :)
>
> HTH,
>
> -tim
>
>
>
Hi Tim,
oh yeah! :) Thank you fo rthe regexps!
Short explanation, what I intent to do:
I have two directory trees. One is on my hd, the other one on a
DVD-RAM, both containing lots of files. The directory structure
is very similiar.
To proof, that the DVD-RAM has no file, which does not exist on the
hd I generate a checksum, (whirlpooldeep) of each file on the DVD-RAM
and on the hd. To make the output useable as input for "uniq" I
decided to insert either "dvdram" or "hd" after the checksum. Then I
put both files into one and sort the whole thing - key are the
characters of the checksum only.
Then (and this the part of vim): If I find to rows which have the
word "DVD-RAM" in their second column I found one file on the
DVD-RAM, which is not on the hd.
As you already mentoined: The lengths of the filenames may be very
different -- the reason why I was searching for a "below this
item"-trick.
Keep hacking!
mcc