extract substring by regex from a text file

Neil Cerutti neilc at norwich.edu
Thu Apr 15 09:25:52 EDT 2010


On 2010-04-15, Alessio <alessio.dl at gmail.com> wrote:
> Hi,
>
> I'm facing the problem in the subject:
> - I have a text file that I need to parse for producing a specifical
> string (Json like) extracting some information (substring) in it;
> - I created regural expressions capable to locate these substrings in
> my txt file;
>
> now I don't know how to continue. What is the best way to locate some
> string in a file and output them (with print command or in another
> file)?

grep

Or: show your work.

-- 
Neil Cerutti



More information about the Python-list mailing list