python/postgres query

Spyro Polymiadis spiz at spiz.no-ip.com
Wed May 29 12:21:09 CST 2013


Thanks for all the help folks,

I ended up doing a loop over the path list
Something like 

For path in paths
 if path in paths
  Delete any matching lines in paths
  Print path (so I can still retain the path)

So this effectively removes any lines with /path/to/folder/subfolder when
the path im using in the if is /path/to/folder

It seems to work :)


On 29/05/13 10:59 AM, "Daniel O'Connor" <darius at dons.net.au> wrote:

>
>On 29/05/2013, at 9:52, Jon <jon at jojati.com> wrote:
>> not 100% sure if i understand the question, but if you have all those
>>paths in newline delimited string, you can probably just use a regex.
>> 
>> i don't know python, but you can shell out to do
>> 
>> `cat $variable | sed '/.*\/.*\//d'`
>
>You can do REs in python http://docs.python.org/2.7/library/re.html
>
>--
>Daniel O'Connor software and network engineer
>for Genesis Software - http://www.gsoft.com.au
>"The nice thing about standards is that there
>are so many of them to choose from."
>  -- Andrew Tanenbaum
>GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
>
>
>
>
>
>
>
>-- 
>LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.freenode.net
>To unsubscribe or change your options:
>  http://www.linuxsa.org.au/mailman/listinfo/linuxsa
>
>--
>This message was scanned by ESVA and is believed to be clean.
>Click here to report this message as spam.
>http://spam.uniquegrafix.com.au/cgi-bin/learn-msg.cgi?id=4EEDD27EBF.3DB19
>
>


-- 
This message was scanned by ESVA and is believed to be clean. 




More information about the linuxsa mailing list