CSVファイルをそのまま出力したいのですが2列目で終わってしまいます。お願いします助けてください。
プログラムソース
#include <stdio.h>
#define N 5500 //入力の最大行数
// csvデータの表示順
// (1)world_cup, (2)match_id, (3)home, (4)away, (5)h_score, (6)a_score,
// (7)match_number, (8)new_match_number, (9)date,
// (10)time,(11)stadium,(12)attendance,(13)phase,(14)year,(15)host
int main(void) {
FILE *input, *output; //ファイルポインタを宣言
char data[N][256] = {""}; //データの格納先
int i;
input = fopen("10_FIFAWC.csv", "rt"); // https://raw.githubusercontent.com/mneedham/neo4j-worldcup/master/data/import/matches.csv//2022/6/2
if (input != NULL) {
for (i = 0; i < N; i += 7) {
fscanf(input, "%[^,], %[^,], %[^,], %[^,], %[^,], %[^,], %s\n", data[i],
data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5],
data[i + 6]);
printf("%s\n", data[i]);
}
} else {
printf("入力ファイルを開けません\n");
}
fclose(input);
output = fopen("output.csv", "wt");
for (i = 0; i < N; i++) {
fprintf(output, "%s\n", data[i]);
}
fclose(output);
printf("\n処理が終了しました.入力ファイルをクローズします\n\n");
}
CSVファイル

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。