1
をCSVファイルに列に変数を追加し、私はそのファイルを10回複製したいが、毎回最初の列に変数を追加します。は、私は大きなファイル(〜10ギガバイト)を持っている
for i in (1, 10):
var = (i-1) * 1000
# add var to the first column of the file and save the file as file(i).csv
ので、私は試みました:
#!/bin/bash
for i in {1..10}
do
t=1
j=$(($i - t))
s=1000
person_id=$((j * add))
awk -F"," 'BEGIN{OFS=","} NR>1{$1=$1+$person_id} {print $0}' file.csv > file$i.csv
done
ただし、列の値は変更されません。
ありがとうございました! – Malgi