| | |
script to display list of files with a particular string matching,plus a few things
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jan 2009
Posts: 33
Reputation:
Solved Threads: 0
script to display list of files with a particular string matching,plus a few things
0
#1 Jun 6th, 2009
Hello,
I want a simple Php script which does the following:
(a) List all file names alphabetically such that the LAST 3 letters of the file name match with one of a few strings entered by the user at runtime
For eg, two strings PDF and TXT are specified by user at runtime, and in the directory there are 4 files: abcpdf.zip, abctxt.zip, xyzpdf.zip and xyztxt.zip
Then the script should create the following records in a mysql database:
(1) From the files abcpdf.zip and abctxt.zip, the script should extract the string 'abc' and create a record in table 'A' with the string abc as one of the fields
(2) In another table 'B' there should be one record for abctxt.zip and abcpdf.zip
This should also be done for xyzpdf.zip and xyztxt.zip, and for all files which have last 3 letters as 'pdf' or 'txt'.
At run time, upto 6 different strings (like 'pdf' or 'txt' should be specified by the user)
FOr the mysql records kindly create a generic statement of inserting data into a table, i will update that statement with the actual data required
Thanks in advance,
Arvind
I want a simple Php script which does the following:
(a) List all file names alphabetically such that the LAST 3 letters of the file name match with one of a few strings entered by the user at runtime
For eg, two strings PDF and TXT are specified by user at runtime, and in the directory there are 4 files: abcpdf.zip, abctxt.zip, xyzpdf.zip and xyztxt.zip
Then the script should create the following records in a mysql database:
(1) From the files abcpdf.zip and abctxt.zip, the script should extract the string 'abc' and create a record in table 'A' with the string abc as one of the fields
(2) In another table 'B' there should be one record for abctxt.zip and abcpdf.zip
This should also be done for xyzpdf.zip and xyztxt.zip, and for all files which have last 3 letters as 'pdf' or 'txt'.
At run time, upto 6 different strings (like 'pdf' or 'txt' should be specified by the user)
FOr the mysql records kindly create a generic statement of inserting data into a table, i will update that statement with the actual data required
Thanks in advance,
Arvind
Re: script to display list of files with a particular string matching,plus a few things
0
#2 Jun 6th, 2009
Does pdf and txt have to be as a string or jumbled up chars?
Posts should be like mini-skirts, long enough to cover enough, but not too long that you cover too much.
My Liveperson: http://liveperson.com/josh-connerty/
My Liveperson: http://liveperson.com/josh-connerty/
Re: script to display list of files with a particular string matching,plus a few things
0
#3 Jun 6th, 2009
•
•
Join Date: Jan 2009
Posts: 33
Reputation:
Solved Threads: 0
Re: script to display list of files with a particular string matching,plus a few things
0
#4 Jun 6th, 2009
Re: script to display list of files with a particular string matching,plus a few things
0
#5 Jun 7th, 2009
Well good thats easier for you then.
You need to look into PHP scandir() and PHP explode() then take a look at the mysql_() functions.
This will basicly tell you what you need to know.
You need to look into PHP scandir() and PHP explode() then take a look at the mysql_() functions.
This will basicly tell you what you need to know.
Posts should be like mini-skirts, long enough to cover enough, but not too long that you cover too much.
My Liveperson: http://liveperson.com/josh-connerty/
My Liveperson: http://liveperson.com/josh-connerty/
Re: script to display list of files with a particular string matching,plus a few things
0
#6 Jun 7th, 2009
![]() |
Similar Threads
- how to recursive search of subdiretories in BASH script (Shell Scripting)
- PyGame2exe help (Python)
- List of files with full path in javascript (JSP)
- list all files in directory and subdirectories (JSP)
- How to list all files in all directories (C++)
- After my script does ftp, it can't delete the files - URGENT (Shell Scripting)
- Horspool Algorithm for String Matching (C++)
- Need Urgent Help with 2 Projects (Shell Scripting)
Other Threads in the PHP Forum
- Previous Thread: $_GET not working IFRAME ...need to send variable to inframe ...please help
- Next Thread: On load type function using PHP?
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop parse paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source space speed sql structure subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube






