Tag Info

New answers tagged


Python was compiled with 2-byte representations of unicode characters instead of 4-byte representations. Fix by re-configuring with ./configure --enable-unicode=ucs4 See the following: http://effbot.org/pyfaq/when-importing-module-x-why-do-i-get-undefined-symbol-pyunicodeucs2.htm


You can use a while loop that gets fed by a find through process substitution: d=0 while IFS= read -r file do [ "$d" -ge 1 ] && tail -n +2 "$file" || cat "$file" (( d ++ )) done < <(find "/dir/folder" name *.dat) So it will perform a cat on the first match and tail -n +2 on the rest. Alternatively, if you have all the files in the ...


Using awk in a single folder awk 'NR==1 {header=$_} FNR==1 && NR!=1 { $_ ~ $header getline; } {print}' *.dat > out find and awk if you need all files in the current folder and in the subfolders. You can replace . with your desired folder. find . -type f -name "*.dat" -print0 | \ xargs -0 awk 'NR==1 {header=$_} FNR==1 && NR!=1 { $_ ...

Top 50 recent answers are included