Skip to content

Instantly share code, notes, and snippets.

@jjrom
Created November 14, 2018 21:26
Show Gist options
  • Save jjrom/3c8335ff9f59f40ef89a3fe5aa82751b to your computer and use it in GitHub Desktop.
Save jjrom/3c8335ff9f59f40ef89a3fe5aa82751b to your computer and use it in GitHub Desktop.
Split a large SQL query file with one COPY to a large SQL query file with several COPY (one every 10000 lines)
sed '0~10000 s/$/\n\\\.\nCOPY landcover\.landcover \(ogc_fid, wkb_geometry, dn\) FROM stdin\;/g' < itag_landcover.sql > itag_landcover.sql.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment