Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 4 Next »

List of Contents

'csvimport'와 'csvexport' 는 csv 파일을 마크베이스 서버에 import/export 하기 위해 사용되는 도구이다.

csvimport

csvimport를 이용하면 쉽게 csv 파일을 서버에 입력할 수 잇다.

Basic use

테이블 명과 데이터 파일명을 다음의 옵션에 따라 입력하여 수행한다.

Option:

-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:

csvimport -t table_name -d table_name.csv
csvimport table_name file_path 
csvimport file_path table_name


Exclude a header

입력시에 csv 파일의 헤더를 빼고 입력하려면 다음의 옵션을 사용한다.

Option:

-H: Set the first line in the csv file as a header which is excluded in importing.


Example:

csvimport -t table_name -d table_name.csv -H


Create a table

입력시 입력할 테이블을 생성하지 않은 경우, 다음 옵션을 통해서 테이블 생성도 동시에 수행할 수 있다.

Option:

-C: Create a table with the columns in order of C0, C1, ... with data type of varchar(32767).
-H: Set the first line of csv file as a header with the data type of varchar(32767).


Example:

csvimport -t table_name -d table_name.csv -C
csvimport -t table_name -d table_name.csv -C -H


csvexport

'csvexport'로 데이터베이스 테이블 데이터를 csv 파일로 쉽게 export할 수 있다.

Basic use

Option:

-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:

csvexport -t table_name -d table_name.csv
csvexport table_name file_path 
csvexport file_path table_name


Add a header

다음의 옵션을 이용하면, Export할 csv파일에 칼럼명으로 헤더를 추가할 수 있다.

Option:

-H: Set the column names of the table as the names of the fields in the first line of exported csv file.

Example:

csvexport -t table_name -d table_name.csv -H



  • No labels