List of Contents
'csvimport'와 'csvexport' 는 csv 파일을 마크베이스 서버에 import/export 하기 위해 사용되는 도구이다.
csv파일에 대해서 machloader 를 이용하여 보다 간단하게 사용할 수 있도록 옵션을 단순화하였다.
csvimport
csvimport를 이용하면 쉽게 csv 파일을 서버에 입력할 수 잇다.
...
기본 사용법
테이블 명과 데이터 파일명을 다음의 옵션에 따라 입력하여 수행한다.
Option:
Code Block |
---|
-t: Set테이블명 table지정 name.옵션 -d: Set데이터 name파일명 of data file. 지정 옵션 * It옵션을 can지정하지 import않고 with테이블명과 the데이터 table파일명만으로도 name수행할 and the file path specified without '-t' and '-d' option수 있다. |
Example:
Code Block |
---|
csvimport -t table_name -d table_name.csv csvimport table_name file_path csvimport file_path table_name |
...
CSV 헤더 제외
입력시에 csv 파일의 헤더를 빼고 제외하고 입력하려면 다음의 옵션을 사용한다.
Option:
Code Block |
---|
-H: Setcsv파일의 the첫번째 first라인을 line헤더로 in인식하고 the csv file as a header which is excluded in importing입력하지 않는다. |
Example:
Code Block |
---|
csvimport -t table_name -d table_name.csv -H |
...
테이블 자동 생성
입력시 입력할 테이블을 생성하지 않은 경우, 다음 옵션을 통해서 테이블 생성도 동시에 수행할 수 있다.
Option:
Code Block |
---|
-C: Createimport할 a때 table테이블을 with자동 the생성한다. columns in order of C0칼럼명은 c0, C1c1, ... with자동으로 data생성된다. type생성되는 of칼럼은 varchar(32767) 타입이다. -H: Set the first line of import할 때 csv file헤더명으로 as a header with the data type of varchar(32767)칼럼명을 생성한다. |
Example:
Code Block |
---|
csvimport -t table_name -d table_name.csv -C csvimport -t table_name -d table_name.csv -C -H |
...
'csvexport'로 데이터베이스 테이블 데이터를 csv 파일로 쉽게 export할 수 있다.
...
기본 사용법
Option:
Code Block |
---|
-t: Set테이블명 a지정 table옵션 name. -d: Set데이터 a파일명 name of data file. 지정 옵션 * It옵션을 can지정하지 export않고 with테이블명과 the데이터 table파일명만으로도 name수행할 and the file path specified without '-t' and '-d' option수 있다. |
Example:
Code Block |
---|
csvexport -t table_name -d table_name.csv csvexport table_name file_path csvexport file_path table_name |
...
CSV헤더 사용
다음의 옵션을 이용하면, Export할 csv파일에 칼럼명으로 헤더를 추가할 수 있다.
Option:
Code Block |
---|
-H: Set테이블 the칼럼명으로 columncsv파일의 names of the table as the names of the fields in the first line of exported csv file헤더를 생성한다. |
Example:
Code Block |
---|
csvexport -t table_name -d table_name.csv -H |
...