Reading directory and storing file details in Database
Python File
Read the CSV file as downloaded from Analytics
Read all the file details from MySql table getting tracking page name
Create table for the month using previous month table structure.
Run the query to create table in SQLITE database.
Full code : Copy to clipboard
Creting plus2_search_file in MySql
Create list of directories to be read.
Loop through all list of directories and create path.
Inside the loop read file modified data, file size.
Inside the file read the title, file description , keyword and track ( Unique identification of the file )
Insert all these details to the MySQL table
Display error message if any
Reading file details of the directories and then storing in MySQL database
Full code : Copy to clipboard
Using SQLite
Full code : Copy to clipboard
Creating Sitemap xml file from a directory
Reading Sitemap xml file and fetching details to store
Moving the file position by seek() »
We can read the file position by tell() »
« File Append
File Write »
Author & Instructor at
plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery,
and web development at plus2net. The tutorials focus on clear explanations, working
examples, and code that readers can test and adapt while learning.
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com