removing last row from text file
Hello,
I need to delete a bottom row from the text file, for example if we have 10 rows, I need to delete the 10th row (one in bottom).
please do suggest me
thanks
Sam.
May 19th, 2011 3:26pm
If you can distinquish the footer/trailer record, then you can use the Conditional Split.
If not this could be a good option:
http://microsoft-ssis.blogspot.com/2011/02/how-to-skip-trailer-records.html
See also other threads in this forum like:
http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/dae004ef-1034-4540-892e-66e7e9be40af/#477afece-5b61-47c9-80d5-e8d2f745e57d
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2011 3:30pm
Hi Sam,
You can use Bulk Inset task and specify the Last Row option to achieve this.
or
using the row_number..over keywords to find the row number as people do in Oracle.
or
based on the meta data, I mean a unique or identity field can be used to fine the last record.
Thanks Ayyappan Thangaraj UG Lead, Puducherry, http://SQLServerRider.blogspot.com
May 19th, 2011 3:56pm
Hi Sam,
You can use Bulk Inset task and specify the Last Row option to achieve this.
...
Thanks Ayyappan Thangaraj UG Lead, Puducherry, http://SQLServerRider.blogspot.com
The Bulk insert works fine, but only if you know the total number if records... example: if you know you have 10 records in the file you specify last row as 9.Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2011 4:14pm
Yes, that's correct. we should know number of rows in the file. :)Thanks Ayyappan Thangaraj UG Lead, Puducherry, http://SQLServerRider.blogspot.com
May 19th, 2011 4:21pm