view · edit · sidebar · attach · print · history

6.2.2020

  • awk, Resort by first column
awk -F ";" 'BEGIN { OFS = ";" } FNR==NR{a[$1]=$2;next} ($1 in a) {print $1,$2,$3,$4,$5,a[$1]}' drugshortage.txt zr_umsatz_absatz.csv > out.csv
  • -F is input delimiter
  • OFS is output delimiter
  • first file only contains PC
  • Output file contains 5 columns of second input file

24.1.2020

  • Append timestamp when copying files
 TIMESTAMP=$(date +%Y%m%d_%H%M)

20.1.2020

  • Comparing two files with awk and output non matching lines
 https://stackoverflow.com/questions/21415525/comparing-two-files-with-awk-and-output-non-matching-lines
 grep -vFxf file2 file1
  • Compare two files for matching lines and store positive results
 awk 'FNR==NR{a[$1];next}($1 in a){print}' file2 file1
 grep -Ff File2 File1
  • Remove leading zeros

http://www.unixcl.com/2010/04/remove-leading-zero-from-line-awk-sed.html

 :1,$ s/^[0]*//

16.1.2020

  • Find the largest files
 find -type f -exec du -Sh {} + | sort -rh | head -n 5

Verzeichnis nach Jahren

view · edit · sidebar · attach · print · history
Page last modified on February 06, 2020, at 03:00 PM