Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

grep alternative in python

import re
with open("filename") as origin_file:
    for line in origin_file:
        line = re.findall(r'something', line)
        if line:
           line = line[0].split('"')[1]
        print line
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #grep #alternative #python
ADD COMMENT
Topic
Name
8+4 =