我想知道如何从bash脚本中的第二行到文件末尾读取每一行csv文件。
我知道如何在bash中读取一个文件:
- while read line
- do
- echo -e "$line\n"
- done < file.csv
- tail -n +2 file.csv
从man page:
- -n,--lines=N
- output the last N lines,instead of the last 10
- ...
- If the first character of N (the number of bytes or lines) is a '+',print beginning with the Nth item from the start of each file,other-
- wise,print the last N items in the file.
用英语说明:
tail -n 100打印最后100行
tail -n 100打印从行100开始的所有行