Quantcast
Channel: Extract specified field value from filename using positional indexing - Code Review Stack Exchange
Browsing latest articles
Browse All 2 View Live

Answer by 200_success for Extract specified field value from filename using...

This task is nearly equivalent to another recent question. My advice is that string analysis is usually best done using regular expressions.import osimport redef get_field_str(file_path, field):""" Get...

View Article



Extract specified field value from filename using positional indexing

I have some filenames, and they each have data contained in them at specific locations in the string. I want a function that returns the value of the data specified by field. The doctest...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images