Hello,
Here is the job we need.
I hve an SQL Table that looks like this;
MYSQL INFORMATION:
parent_categ_id INT(10)
categ_id INT(10) KEY (no auto increment)
description Varchar(200)
level INT(1)
[categ_id] [parent_categ_id] [description] [level]
I have a 6200 line text data file formatted like this, where each line is a row of categories separated by a slash '/' for instance :
Antiques
Antiques/Antiquities
Antiques/Antiquities/Byzantine
Antiques/Antiquities/Celtic
Antiques/Architectural
Antiques/Architectural/Brass
Antiques/Architectural/Tole
Antiques/Asian Antiques
Antiques/Books
Antiques/Decorative Arts
......
I need you to create a PHP script that parses the 6200 lines of data in the text file and puts it into the mysql table
* The categ_id will be an manually incremented number ie; $i++ not 'auto increment' field
* The parent_categ_id will be its parents categ_id AND NOT the parent description so the parent of Celtic will be 1
* The description will be the actual category as shown above ie; 'Celtic'
* The level will be how many levels of categories up to this category ie; for Celtic it would be level=2 because each category previous counted up as (0,1,2)
The Rules: It must look like this
We must start the first item as having a categ_id=1 and parent_categ_id=0
So, Antiques in the above example would look like this
[categ_id] [parent_categ_id] [ description ] [level]
[1] [0] [ 'Antiques' ] [0]
[2] [1] ['Antiquities' ] [1]
[3] [2] [ 'Byzantine' ] [2]
[4] [2] [ 'Celtic' ] [2]
[5] [1] ['Architectural' ] [1]
[6] [5] [ 'Brass' ] [2]
[7] [5] [ 'Tole' ] [2]
[8] [1] ['Asian Antiques' ] [0]
[9] [1] [ 'Books' ] [0]
[10] [1] ['Decorative Arts'] [0]
So you must understand that no category shows up more than one time in our table even though it shows up numerous times in the text file.
In the end, this will provide a way for us to know each category and what the parent of that category is so we may build a category tree for products.
I have attached the 6200 line category file for your review.
Thank you.
Jay
CompuMatter
Hi there
I have done this before. I mean, have parsed multilevel tree data into mysql. I can easily do this job in Java. Looking forward to hear from you.
Thanks
Rinsad
$44 USD 1 gün içinde
4,9 (1217 değerlendirme)
9,4
9,4
10 freelancers are bidding on average $107 USD for this job
hi,
my name is shahid, i am working in web development from past four year. Will provide you quality work and hopefully we will have long term relationship in web development. let me know if i can help you. thanks
Dear Sir,
I can parse your text file to mysql table without use php code, i can write a mysql store procedure to parse your text file. Please let me know if you accept my method.
Best regards,
Thanh
Hello Sir,
I can do this task. I will insert all record into Your DB. I have handled dump data before and inserted it into DB. I can also do Your task.
Give me the opportunity to work with You.
Thanks and Regards,
Ripa Saha