bash - Deleting first row of each csv file using sed -


i trying delete first row of each of .csv files in dir folder using sed:

dir=/home/results filename in "$dir";         sed 1d filename.csv done 

however, doesn't work. new bash scripting , thankful if tells me how fix this.

just do:

for f in /home/results/*.csv; sed -i '1 d' "$f"; done 

the glob pattern /home/results/*.csv matches .csv files in /home/results/ directory , for construct iterate on files, sed in place removal of first row each file.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -