I ask of you but yet another simplistic question that I hope can be answered. Its better explained showing my code. Here is my list(tmp_pkglist), which contains a list of all Debian (Jessie) packages:
snippet
Using this block of code and using re.findall, how can I tell the regex to "not" or inversely find all of the lines that do not contain:
I tried various combos but cannot get the inverse of what I want which is:
For example:
I am used to using "!" or boolean "not" but have never done it using Pythons "re" module. Thanks in advance.
---------- Post updated at 11:49 AM ---------- Previous update was at 10:44 AM ----------
This did the trick:
Thanks to grail from antother forum
I am trying to discover the sequence of escape characters that I need to pass ksh in order to turn inverse video on and off. I need this information for two reasons:
* I want to include inverse video text in some shell scripts
* I wish to highlight a section of an /etc/motd file
Thanks for... (2 Replies)
I need to inverse a matrix given in a file.
The problem is I'm stuck with writing determinant finding algoritm into code.
I found this algoritm about finding determinant of nxn matrix. This is what i need:
Matrices and Determinants
and here:
a11 a12 a13
a21 a22 a23
a31 a32 a33... (0 Replies)
I think this is a very challenging problem I am facing and I have no idea how to deal with it
Suppose I have two csv files
A.csv
Toyota Camry,1998,blue
Honda Civic,1999,blue
B.csv
Toyota Inc. Camry, 2000km
Honda Corp Civic,1500km
I want to generate C.csv
Toyota Camry,1998,blue... (7 Replies)
Hi List,
I have a CSV file which I am manipulating. Each time I receive the CSV for processing, there will be extra columns of data.
Here's what I want to do; I want to be able to remove specific columns from the CSV data file, but keep the remaining columns, where the remaining columns are... (3 Replies)
Hi,
I'm trying to wtite a script which actually print the text which doesn't contain a word , i mean to say.
eg:- if a file contains the follwoing data
Hello how ru ???
What ru doing ?
what is the % of data contained ???
I want to write a script such that it prints the line excluding... (1 Reply)
Below is my code for comparing string for Exact Match found in python.
for word in jdbc_trgt.split(','):
global comp
comp=word.strip();
print "GloBAL:" + comp
fiIn = open('list.txt').readlines()
for lines in fiIn:
print "line1s:" +... (6 Replies)
Hi everyone.
I'm trying to learn python as it relates to parsing xml, and I thought I would start by trying to create an easy (or I thought would be easy) function
to match on a certain attribute in an xml file and print out it's related attribute.
Here's an example to hopeful make sense of... (0 Replies)
Hi all...
As you know I like making code backwards compatible for as many platforms as possible.
This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)