csv.join_file

View page source

Join The Tables In Two Csv Files

Prototype

# at_cascade.csv.join_file
def join_file(
    left_file    ,
    right_file   ,
    result_file  ,
) :
    assert type(left_file)  == str
    assert type(right_file)  == str
    assert type(result_file)  == str

left_file

Is the name of the first csv files. Its columns will come first in the output file (and in the same order as in left_file ).

right_file

Is the name of the second csv file. Its columns will come second in the output file (and in the same order as in right_file ). This file must have the exact same number or rows as left_file .

result_file

Is the name of the resulting file. It will have all the columns in left_file and right_file. The values in the i -th row of result_file will be the corresponding values in the i -th row of left_file and right_file. If a column appears in both files, the position of the column is its position in left_file, and its value is the value in right_file .

Example

csv.join_file_xam