Skip to main content

extracting/copy ranges of columns from large data file

I was trying to prepare data files from one large file by extracting columns and pasting into a new file.

The number of columns of the given data is very large. I want to prepare a number of data files by splitting the data.
I was trying the script below, but it is not working. I expect the error is due to specifying ranges of columns to copy.

#!/bin/bash

paste <(awk '{print $1,$2,$3,...$19,$20}' Precipitation.csv ) > aaaaa1
paste <(awk '{print $21,$22,$23,...$39,$40}' Precipitation.csv ) > aaaaa2 
paste <(awk '{print $41,$42,$43,...$99,$100}' Precipitation.csv ) > aaaaa3 

Would you please help me in correcting the code?

AiB
  • 797
  • 3
  • 12
  • 30