yec/tab2sql
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
TAB2SQL
-------
Generate sql file for MYOB TAB seperated file exports.
USAGE
-----
./tab2sql.sh {sourcefile} {tablename}
Generates statements to insert into {tablename} using {sourcefile}
Statements are saved to {tablename}.sql
To enter into mysql
mysql -u{username} -p{password} {database} < {tablename}.sql
FEATURES
--------
* Column names to alphanumeric and lowercase.
* MYOB exports columns with non unique names. tab2sql adds a
suitable prefix. e.g. line2 becomes addr1line2.
* Columns are VARCHAR with length determined by the longest
field + 10. If the column ends in id column will be INT.
TODO
----
* Handle columns longer than 255.
* Handle more data types.
* Determine if column should be index.