Thursday, September 30, 2021

Concatenate multiple files with same headers (and only keep one header line in the output file) - Version2

 Put this into an AWK script and call it merge.awk:


BEGIN{

    h=ARGV[1];

    ARGV[1]="";

}



{

    if(FNR==1){print}

    else if($1!~h){print}

}


and use an argument:

cat *.csv | awk -f merge.awk "<header>" > output.csv

No comments:

Post a Comment

Any comments?

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...