How to import a CSV file

General JoomLeague Discussions

Moderator: And_One

master_JE
Newbie
Posts: 12
Joined: Tue Feb 01, 2011 9:11 pm

How to import a CSV file

Postby master_JE » Tue Feb 08, 2011 3:25 pm

Has someone a sample how to import a csv file?

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: How to import a CSV file

Postby timoline » Tue Feb 08, 2011 4:13 pm

example of what? clubs, persons, teams?

Example clubs:|

# IMPORT club POSSIBLE COLUMNS: id, name, alias, admin, address, zipcode, location, state, country, founded, phone, fax, email, website, president, manager, logo_big, logo_middle, logo_small, standard_playground, extended, ordering, checked_out, checked_out_time

User avatar
kubik
.
Posts: 618
Joined: Tue Nov 03, 2009 7:20 pm
Joomleague version: 2.0.x
Location: Oberschlesien
Contact:

Re: How to import a CSV file

Postby kubik » Tue Feb 08, 2011 5:51 pm

timoline wrote:example of what? clubs, persons, teams?

Example clubs:|

# IMPORT club POSSIBLE COLUMNS: id, name, alias, admin, address, zipcode, location, state, country, founded, phone, fax, email, website, president, manager, logo_big, logo_middle, logo_small, standard_playground, extended, ordering, checked_out, checked_out_time


Timo... do you have any template file of .csv for persons? :confused:

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: How to import a CSV file

Postby timoline » Tue Feb 08, 2011 6:35 pm

sure, but its easy to create ...

for example
create 1 person with all the fields of your needs in the backend of joomleague.
open phpmyadmin, and export the table jos_joomleague_person in CSV format

User avatar
kubik
.
Posts: 618
Joined: Tue Nov 03, 2009 7:20 pm
Joomleague version: 2.0.x
Location: Oberschlesien
Contact:

Re: How to import a CSV file

Postby kubik » Tue Feb 08, 2011 7:08 pm

timoline wrote:sure, but its easy to create ...

for example
create 1 person with all the fields of your needs in the backend of joomleague.
open phpmyadmin, and export the table jos_joomleague_person in CSV format


I know that :whistling: but when I tried import .CSV at backend of my JoomLeague I had error.


Diddipoeler left an attachement: jos_joomleague_person.zip ( viewtopic.php?f=13&t=10617&start=0 ) but his file is broken.

Im using only PhpMyAdmin for import/export tables and its working fine for me, but importing from backend of Joomleague is easier and faster. But... its not working. :confused:

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: How to import a CSV file

Postby timoline » Tue Feb 08, 2011 8:02 pm

just tested, works fine

CSV-IMPORT INSTRUCTIONS

* IMPORT person COLUMN NAMES
* IMPORT person CSV FORMAT
* CSV FORMAT AS DEFINED IN rfc 4180
* IMPORT person POSSIBLE COLUMNS: id, user_id, firstname, lastname, nickname, alias, country, knvbnr, birthday, height, weight, picture, show_pic, show_persdata, show_teamdata, show_on_frontend, info, notes, phone, mobile, email, website, address, zipcode, location, state, address_country, extended, published, ordering, checked_out, checked_out_time, position_id


Make sure you also export the column names, Put fields names in the first row

But I think I see your problem;
the extended data is a bit weird in the csv file, and_one do you also see this problem?

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: How to import a CSV file

Postby And_One » Tue Feb 08, 2011 8:26 pm

give me an example csv and i will test it.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: How to import a CSV file

Postby timoline » Tue Feb 08, 2011 8:49 pm

And_One wrote:give me an example csv and i will test it.


sent

Kohhal
.
Posts: 24
Joined: Thu Oct 11, 2007 9:33 pm
Location: Dublin, Ireland

Re: How to import a CSV file

Postby Kohhal » Thu Feb 10, 2011 11:00 am

I figured this out eventually too, the instructions are not too clear if you are not familiar with .csv format etc...

First line of the file contains the fields you plan to import, which is just a plain txt file* called yourfile.csv :

lastname,firstname,birthday,country

The rest of the file has all your data following the format of the first line, so :

Smith,Cassandra,01/11/1975,AUS
Jones,Louise,01/03/1980,AUS


If you are getting errors, you might need to create a sample of what you want to import in the backend, and then check the format of how it is stored in the database e.g the format for date above, or the country codes etc...

Here is how the file looks in the end :

Code: Select all

lastname,firstname,birthday,country
Sims,Cassandra,01/11/1975,AUS
Mcintosh,Louise,01/03/1980,AUS


Hope this helps anyone else.

*If you are creating the file in excel, you can then save it as type .csv

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: How to import a CSV file

Postby And_One » Thu Feb 10, 2011 11:30 am

dont forget to setup the correct separator char on the import form: comma , or semicolon ;

master_JE
Newbie
Posts: 12
Joined: Tue Feb 01, 2011 9:11 pm

Re: How to import a CSV file

Postby master_JE » Fri Feb 11, 2011 4:11 pm

timoline wrote:
And_One wrote:give me an example csv and i will test it.


sent

Can you send me one 2 :whistling:

Kohhal
.
Posts: 24
Joined: Thu Oct 11, 2007 9:33 pm
Location: Dublin, Ireland

Re: How to import a CSV file

Postby Kohhal » Fri Feb 11, 2011 4:20 pm

The code in my post is an example, just copy paste to notepad, save as example.csv and import.

The possible field values you can use are :

IMPORT person POSSIBLE COLUMNS: id, user_id, firstname, lastname, nickname, alias, country, knvbnr, birthday, height, weight, picture, show_pic, show_persdata, show_teamdata, show_on_frontend, info, notes, phone, mobile, email, website, address, zipcode, location, state, address_country, extended, published, ordering, checked_out, checked_out_time, position_id
You do not have the required permissions to view the files attached to this post.
Last edited by Kohhal on Fri Feb 11, 2011 5:52 pm, edited 1 time in total.

User avatar
teddy
.
Posts: 305
Joined: Wed Feb 28, 2007 12:01 pm

Re: How to import a CSV file

Postby teddy » Fri Feb 11, 2011 5:20 pm

Guys, I think rather than a text editor, using Calc or Excel is more easily explainable:
each column in a spreadsheet can be given a name among "id, user_id, firstname, lastname, nickname, alias, country, knvbnr, birthday, height, weight, picture, show_pic, show_persdata, show_teamdata, show_on_frontend, info, notes, phone, mobile, email, website, address, zipcode, location, state, address_country, extended, published, ordering, checked_out, checked_out_time, position_id"
and on each column you can put related data as in Kohhal example.
Then export as *.csv. That simple.
Do you agree? Maybe I can (or better some english speaker) put it in Wiki..

Kohhal
.
Posts: 24
Joined: Thu Oct 11, 2007 9:33 pm
Location: Dublin, Ireland

Re: How to import a CSV file

Postby Kohhal » Fri Feb 11, 2011 7:01 pm

I added the procedure to the Wiki, hopefully it makes some sense...

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: How to import a CSV file

Postby timoline » Fri Feb 11, 2011 7:37 pm

Kohhal wrote:I added the procedure to the Wiki, hopefully it makes some sense...

:thx: where?

User avatar
teddy
.
Posts: 305
Joined: Wed Feb 28, 2007 12:01 pm

Re: How to import a CSV file

Postby teddy » Fri Feb 11, 2011 7:47 pm


warteckel
Newbie
Posts: 7
Joined: Mon Apr 18, 2011 8:14 am

Re: How to import a CSV file

Postby warteckel » Sun Aug 14, 2011 11:57 pm

I try to import csv file and birthday is on dd/mm/yyyy format. After import birthday appears to be 0000-00-00. :bash: Can someone help? Everything else is working fine in the import.

User avatar
kubik
.
Posts: 618
Joined: Tue Nov 03, 2009 7:20 pm
Joomleague version: 2.0.x
Location: Oberschlesien
Contact:

Re: How to import a CSV file

Postby kubik » Wed Aug 17, 2011 1:34 pm

warteckel wrote:I try to import csv file and birthday is on dd/mm/yyyy format. After import birthday appears to be 0000-00-00. :bash: Can someone help? Everything else is working fine in the import.

1. Open your csv file in Open Office
2. Mark your column with age of player
3. Do -> CTRL + 1 and
cells.JPG

4. Click -> OK
5. Save.
6. Done.
7. File is ready.
You do not have the required permissions to view the files attached to this post.
Joomla 2.5.x & 3.x
JoomLeague - Latest Git Version
GG Network No : 5739578
www.RegioLiga.pl

TheWelshOne1983
Newbie
Posts: 14
Joined: Thu Dec 22, 2011 7:17 pm

Re: How to import a CSV file

Postby TheWelshOne1983 » Thu Feb 09, 2012 2:31 pm

With regards to a players picture.

What information do I need to enter for the pictures to be imported into Joomleague? Do I need to upload them to the server first? If so, What folder do they need to be uploaded to?

Thanks

TheWelshOne
Joomleague: 1.5.4
Joomla: 1.5
Homepage: http://www.proevoeliteleagues.co.uk/PEEL

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: How to import a CSV file

Postby And_One » Thu Feb 09, 2012 2:35 pm

<joomla>/media/com_joomleague/persons

TheWelshOne1983
Newbie
Posts: 14
Joined: Thu Dec 22, 2011 7:17 pm

Re: How to import a CSV file

Postby TheWelshOne1983 » Fri Feb 10, 2012 10:12 am

So how do I get the pictures assigned to the correct players when importing a CSV file?
Joomleague: 1.5.4
Joomla: 1.5
Homepage: http://www.proevoeliteleagues.co.uk/PEEL

TheWelshOne1983
Newbie
Posts: 14
Joined: Thu Dec 22, 2011 7:17 pm

Re: How to import a CSV file

Postby TheWelshOne1983 » Fri Feb 10, 2012 10:42 am

I've managed to get the players pics to be automatically assigned to the coresponding team, but for some reason the players is not displayed when viewing the players profile on the front-end, I checked to make sure "show picture" had been selected and it it has, any help would be appreciated.

Thanks

TheWelshOne
Joomleague: 1.5.4
Joomla: 1.5
Homepage: http://www.proevoeliteleagues.co.uk/PEEL

TheWelshOne1983
Newbie
Posts: 14
Joined: Thu Dec 22, 2011 7:17 pm

Re: How to import a CSV file

Postby TheWelshOne1983 » Fri Feb 10, 2012 10:45 am

Ok, it might be something to do with the image file size?
Joomleague: 1.5.4
Joomla: 1.5
Homepage: http://www.proevoeliteleagues.co.uk/PEEL

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: How to import a CSV file

Postby And_One » Fri Feb 10, 2012 11:15 am

check your FES

TheWelshOne1983
Newbie
Posts: 14
Joined: Thu Dec 22, 2011 7:17 pm

Re: How to import a CSV file

Postby TheWelshOne1983 » Fri Feb 10, 2012 11:32 am

Checked FES, settings look fine to me.

I decreased the size of the of the image so the size of the file would decrease and it worked.

Very strange.
Joomleague: 1.5.4
Joomla: 1.5
Homepage: http://www.proevoeliteleagues.co.uk/PEEL

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: How to import a CSV file

Postby And_One » Fri Feb 10, 2012 11:36 am

thats sounds really strange

TheWelshOne1983
Newbie
Posts: 14
Joined: Thu Dec 22, 2011 7:17 pm

Re: How to import a CSV file

Postby TheWelshOne1983 » Fri Feb 10, 2012 11:39 am

Is there a limit?
Joomleague: 1.5.4
Joomla: 1.5
Homepage: http://www.proevoeliteleagues.co.uk/PEEL

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: How to import a CSV file

Postby And_One » Fri Feb 10, 2012 11:42 am

not that i know

User avatar
tibi
.
Posts: 63
Joined: Sat Jan 28, 2012 6:44 pm
Location: Buenos Aires, Argentina
Contact:

Re: How to import a CSV file

Postby tibi » Thu Jul 18, 2013 10:19 pm

Welsh: I think there is a limit to the size in 120Kb, just failed to upload a bigger 240 picture and worked fine with 110kb.

How did you get to relate each person with his photo? thats awsome and cant seem to find how to do it myself. txs in advance

User avatar
tibi
.
Posts: 63
Joined: Sat Jan 28, 2012 6:44 pm
Location: Buenos Aires, Argentina
Contact:

Re: How to import a CSV file

Postby tibi » Thu May 29, 2014 7:51 pm

timoline wrote:just tested, works fine

CSV-IMPORT INSTRUCTIONS

* IMPORT person COLUMN NAMES
* IMPORT person CSV FORMAT
* CSV FORMAT AS DEFINED IN rfc 4180
* IMPORT person POSSIBLE COLUMNS: id, user_id, firstname, lastname, nickname, alias, country, knvbnr, birthday, height, weight, picture, show_pic, show_persdata, show_teamdata, show_on_frontend, info, notes, phone, mobile, email, website, address, zipcode, location, state, address_country, extended, published, ordering, checked_out, checked_out_time, position_id


Make sure you also export the column names, Put fields names in the first row

But I think I see your problem;
the extended data is a bit weird in the csv file, and_one do you also see this problem?


Return to “Public”

Who is online

Users browsing this forum: No registered users and 2 guests