I have thousands of files stored in this location in a CentOs server:
All file names are like this:
This file name represents two numbers (123 and 45678) and a full date (2013/11/29) and a time (15:45:30)
I have a MySQL database named (filedb). A table named (files) has the following columns:
id ===== is a sequential number
source ===== is 123
destination ===== is 45678
date ==== is 11/29/2013
time ==== is 15:45:30
file ==== is the file name 123_45678_2013_11_29_15_45_30.gsm
note ==== is an empty field
I need a script which should insert an entry to the (filedb) database for each file in the /var/source/ directory.
Note that the first two sections (123) and (45678) can vary in length. They may be 3,4,5 or more digits. The only wan to recognise sections is by underscores.
I have already setup a username and a password for accessing the MySQL database.
Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.
There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn the basics of while and for loops in Python.
while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows: while <condition>: do something repeate: The break statement m…