Importing Punches using import_punches.php

Topics brought up by the TimeTrex open source community.
Locked
angelines
Posts: 17
Joined: Tue Jan 24, 2012 7:56 am

Importing Punches using import_punches.php

Post by angelines » Wed Jan 25, 2012 12:40 pm

I'm having trouble importing punches using the import_punches.php.

I edited the import_punches.csv and import_punches2.csv using the same format as it is when timetrex was installed (found in timetrex/tools/import/...).

I did not edit the import_punches.php file as I am new to this and don't know if there's anything that I should edit in there.

When I run the command line:
c:\timetrex\php\php.exe c:\timetrex\timetrex\tools\import\import_punches.php

it gives:
Usage: import_punches.php [OPTIONS] [Column MAP file] [CSV File]
Options: -n Dry-run, display the first two lines to confirm mapping is correct
WARNING: Clear TimeTrex cache after running this.

I cleared the cache and checked Punches on TimeTrex and saw that nothing was imported.

What went wrong?

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Importing Punches using import_punches.php

Post by shaunw » Wed Jan 25, 2012 12:45 pm

You didn't provide the import script with the name of the file that contains the data that you wish to import. See the Usage: line in your comment, it tells you what command line arguments are required and in what order.

angelines
Posts: 17
Joined: Tue Jan 24, 2012 7:56 am

Re: Importing Punches using import_punches.php

Post by angelines » Wed Jan 25, 2012 1:27 pm

Ok, well as I mentioned earlier I never worked with .php files so I'm new to it. I'm attaching the file please tell me exactly where to input the file name. I changed the extension to .txt

The file name is import_punches.csv
The Column Map File is punch_column_map.txt

Thanks.
Attachments
import_punches.txt
php file (extension changed for uploading)
(20.47 KiB) Downloaded 208 times

angelines
Posts: 17
Joined: Tue Jan 24, 2012 7:56 am

Re: Importing Punches using import_punches.php

Post by angelines » Thu Jan 26, 2012 8:27 am

Hi,

I got through. I worked on it and got it to work.

Thanks.

Locked