Skip to main content

Omit Footer WhileLoading the Data using copy

  • Feb 22, 2016 4:26 AM UTC
  • 2 replies
  • 17 views

San2
Forum|alt.badge.img
  • Participating Frequently

HI,

 

Iwant to omit the footer from my files while loading the data using Copy command

 

 

is there any way to omit

 

 

Can any one  help in the issue.

 

 

 

Thanks

 

San2

2 replies

eli_revach
Forum|alt.badge.img+2
  • Participating Frequently
  • Feb 22, 2016 7:58 PM UTC

Hi
In linux environment , you would like to do something like this :


head -n -1 yourfile| vsql -c 'copy table (...) FROM STDIN'


I hope you will find it helpful


Thanks

 


Adrian_Oprea_1
Forum|alt.badge.img+1
  • Participating Frequently
  • Feb 22, 2016 10:49 PM UTC

Why dont you just remove all last lines from all the files you are about to load ! 

 

Use this snipet:

sed -i '$ d' *.csv