I need to import a flat file as follows: Column1,Column2,Column3 1,2,3 4,5,6 (snip) 123,456,789 Downloaded from www.abcdef.com on 02/28/2007. Total1: 12344556 Total2: 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All Rights Reserved. The last line is some kind of signature. I have no problems uploading data lines from 1,2,3 to 123,456,789. The last line is ignored, which is OK. I have 2 problems I cannot solve right now: 1. I need to upload the last line into some other staging table to do some validation, such as to match totals against my control numbers and to verify the date. 2. I need to have line numbers from the text in my target table: LineNumber,Column1,Column2,Column3 1,1,2,3 2,4,5,6 (snip) 300,123,456,789 I think there should be a transformation to add line numbers, but I cannot find any so far. Thanks in advance. BTW, am I asking in the correct newsgroups?
[quoted text, click to view] On Mar 5, 4:16 pm, "Allan Mitchell" <a...@no-spam.sqldts.com> wrote: > You could use this if you want > > Row Number Transformation > ( http://www.sqlis.com/93.aspx) > > -- > > Allan Mitchell http://wiki.sqlis.com| http://www.sqlis.com| http://www.sqldts.com| http://www.konesans.com > > "sqllear...@hotmail.com" <sqllear...@hotmail.com> wrote in message > > news:1173120358.175979.163580@30g2000cwc.googlegroups.com: > > > > > I need to import a flat file as follows: > > > Column1,Column2,Column3 > > 1,2,3 > > 4,5,6 > > (snip) > > 123,456,789 > > Downloaded from www.abcdef.comon 02/28/2007. Total1: 12344556 > > Total2: > > 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All > > Rights Reserved. > > > The last line is some kind of signature. I have no problems uploading > > data lines from 1,2,3 to 123,456,789. > > The last line is ignored, which is OK. > > > I have 2 problems I cannot solve right now: > > 1. I need to upload the last line into some other staging table to do > > some validation, such as to match totals against my control numbers > > and to verify the date. > > 2. I need to have line numbers from the text in my target table: > > > LineNumber,Column1,Column2,Column3 > > 1,1,2,3 > > 2,4,5,6 > > (snip) > > 300,123,456,789 > > > I think there should be a transformation to add line numbers, but I > > cannot find any so far. > > > Thanks in advance. BTW, am I asking in the correct newsgroups?- Hide quoted text - > > - Show quoted text - Thanks Simon and Alan
Hello SQL, Its easy to do in a script component, I've done a demo of this here http://sqlblogcasts.com/blogs/simons/archive/2007/03/05/SSIS---How-do-I-add-rownumber-line-number-to-a-data-flow.aspx or use the component from Jamie Thomson http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Rank-Transform.aspx Simon Sabin SQL Server MVP http://sqlblogcasts.com/blogs/simons [quoted text, click to view] > I need to import a flat file as follows: > > Column1,Column2,Column3 > 1,2,3 > 4,5,6 > (snip) > 123,456,789 > Downloaded from www.abcdef.com on 02/28/2007. Total1: 12344556 > Total2: > 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All > Rights Reserved. > The last line is some kind of signature. I have no problems uploading > data lines from 1,2,3 to 123,456,789. > The last line is ignored, which is OK. > I have 2 problems I cannot solve right now: > 1. I need to upload the last line into some other staging table to do > some validation, such as to match totals against my control numbers > and to verify the date. > 2. I need to have line numbers from the text in my target table: > LineNumber,Column1,Column2,Column3 > 1,1,2,3 > 2,4,5,6 > (snip) > 300,123,456,789 > I think there should be a transformation to add line numbers, but I > cannot find any so far. > > Thanks in advance. BTW, am I asking in the correct newsgroups? >
You could use this if you want Row Number Transformation ( http://www.sqlis.com/93.aspx) -- Allan Mitchell http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com | http://www.konesans.com [quoted text, click to view] "sqllearner@hotmail.com" <sqllearner@hotmail.com> wrote in message news:1173120358.175979.163580@30g2000cwc.googlegroups.com: > I need to import a flat file as follows: > > Column1,Column2,Column3 > 1,2,3 > 4,5,6 > (snip) > 123,456,789 > Downloaded from www.abcdef.com on 02/28/2007. Total1: 12344556 > Total2: > 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All > Rights Reserved. > > > The last line is some kind of signature. I have no problems uploading > data lines from 1,2,3 to 123,456,789. > The last line is ignored, which is OK. > > > I have 2 problems I cannot solve right now: > 1. I need to upload the last line into some other staging table to do > some validation, such as to match totals against my control numbers > and to verify the date. > 2. I need to have line numbers from the text in my target table: > > > LineNumber,Column1,Column2,Column3 > 1,1,2,3 > 2,4,5,6 > (snip) > 300,123,456,789 > > > I think there should be a transformation to add line numbers, but I > cannot find any so far. > > > Thanks in advance. BTW, am I asking in the correct newsgroups?
Hello Allan, The script component rules ;) Simon Sabin SQL Server MVP http://sqlblogcasts.com/blogs/simons [quoted text, click to view] > You could use this if you want > > Row Number Transformation > ( http://www.sqlis.com/93.aspx) > -- > > Allan Mitchell > http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com | > http://www.konesans.com > "sqllearner@hotmail.com" <sqllearner@hotmail.com> wrote in message > news:1173120358.175979.163580@30g2000cwc.googlegroups.com: > >> I need to import a flat file as follows: >> >> Column1,Column2,Column3 >> 1,2,3 >> 4,5,6 >> (snip) >> 123,456,789 >> Downloaded from www.abcdef.com on 02/28/2007. Total1: 12344556 >> Total2: >> 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All >> Rights Reserved. >> The last line is some kind of signature. I have no problems uploading >> data lines from 1,2,3 to 123,456,789. >> The last line is ignored, which is OK. >> I have 2 problems I cannot solve right now: >> 1. I need to upload the last line into some other staging table to do >> some validation, such as to match totals against my control numbers >> and to verify the date. >> 2. I need to have line numbers from the text in my target table: >> LineNumber,Column1,Column2,Column3 >> 1,1,2,3 >> 2,4,5,6 >> (snip) >> 300,123,456,789 >> I think there should be a transformation to add line numbers, but I >> cannot find any so far. >> >> Thanks in advance. BTW, am I asking in the correct newsgroups? >>
Don't get me started :-> -- Allan Mitchell http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com | http://www.konesans.com [quoted text, click to view] "Simon Sabin" <SimonSabin@noemail.noemail> wrote in message news:62959f1a50d078c92d8c0be962c2@msnews.microsoft.com: > Hello Allan, > > The script component rules ;) > > > Simon Sabin > SQL Server MVP > http://sqlblogcasts.com/blogs/simons > > > > You could use this if you want > > > > Row Number Transformation > > ( http://www.sqlis.com/93.aspx) > > -- > > > > Allan Mitchell > > http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com | > > http://www.konesans.com > > "sqllearner@hotmail.com" <sqllearner@hotmail.com> wrote in message > > news:1173120358.175979.163580@30g2000cwc.googlegroups.com: > > > >> I need to import a flat file as follows: > >> > >> Column1,Column2,Column3 > >> 1,2,3 > >> 4,5,6 > >> (snip) > >> 123,456,789 > >> Downloaded from www.abcdef.com on 02/28/2007. Total1: 12344556 > >> Total2: > >> 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All > >> Rights Reserved. > >> The last line is some kind of signature. I have no problems uploading > >> data lines from 1,2,3 to 123,456,789. > >> The last line is ignored, which is OK. > >> I have 2 problems I cannot solve right now: > >> 1. I need to upload the last line into some other staging table to do > >> some validation, such as to match totals against my control numbers > >> and to verify the date. > >> 2. I need to have line numbers from the text in my target table: > >> LineNumber,Column1,Column2,Column3 > >> 1,1,2,3 > >> 2,4,5,6 > >> (snip) > >> 300,123,456,789 > >> I think there should be a transformation to add line numbers, but I > >> cannot find any so far. > >> > >> Thanks in advance. BTW, am I asking in the correct newsgroups? > >>
I think the article does not mean it will not label each line correctly rather it may not number them in the order you expect them to be numbered. Yes our component behaves in a very similar way to this code except we allow seeding and increments. -- Allan Mitchell http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com | http://www.konesans.com [quoted text, click to view] "SQL Learner" <sqllearner@hotmail.com> wrote in message news:1173192125.412108.314920@t69g2000cwt.googlegroups.com: > On Mar 5, 4:16 pm, "Allan Mitchell" <a...@no-spam.sqldts.com> wrote: > > You could use this if you want > > > > RowNumberTransformation > > ( http://www.sqlis.com/93.aspx) > > > > -- > > > > Allan Mitchell http://wiki.sqlis.com| http://www.sqlis.com| http://www.sqldts.com| http://www.konesans.com > > > > "sqllear...@hotmail.com" <sqllear...@hotmail.com> wrote in message > > > > news:1173120358.175979.163580@30g2000cwc.googlegroups.com: > > > > > > > > > I need to import a flat file as follows: > > > > > Column1,Column2,Column3 > > > 1,2,3 > > > 4,5,6 > > > (snip) > > > 123,456,789 > > > Downloaded from www.abcdef.comon 02/28/2007. Total1: 12344556 > > > Total2: > > > 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All > > > Rights Reserved. > > > > > The last line is some kind of signature. I have no problems uploading > > > data lines from 1,2,3 to 123,456,789. > > > The last line is ignored, which is OK. > > > > > I have 2 problems I cannot solve right now: > > > 1. I need to upload the last line into some other staging table to do > > > some validation, such as to match totals against my control numbers > > > and to verify the date. > > > 2. I need to have line numbers from the text in my target table: > > > > > LineNumber,Column1,Column2,Column3 > > > 1,1,2,3 > > > 2,4,5,6 > > > (snip) > > > 300,123,456,789 > > > > > I think there should be a transformation to add line numbers, but I > > > cannot find any so far. > > > > > Thanks in advance. BTW, am I asking in the correct newsgroups?- Hide quoted text - > > > > - Show quoted text - > > > Allan, > > Is your solution similar to the following: > > http://support.microsoft.com/kb/908460 > > If yes, I have a concern: MSDN says "The mycount column does not > necessarily reflect the actual row number in the original source." > Does your solution provide a reliable way of numbering lines in a text > file? > > TIA
[quoted text, click to view] On Mar 5, 4:16 pm, "Allan Mitchell" <a...@no-spam.sqldts.com> wrote: > You could use this if you want > > RowNumberTransformation > ( http://www.sqlis.com/93.aspx) > > -- > > Allan Mitchell http://wiki.sqlis.com| http://www.sqlis.com| http://www.sqldts.com| http://www.konesans.com > > "sqllear...@hotmail.com" <sqllear...@hotmail.com> wrote in message > > news:1173120358.175979.163580@30g2000cwc.googlegroups.com: > > > > > I need to import a flat file as follows: > > > Column1,Column2,Column3 > > 1,2,3 > > 4,5,6 > > (snip) > > 123,456,789 > > Downloaded from www.abcdef.comon 02/28/2007. Total1: 12344556 > > Total2: > > 234523 Total3: 56456 Copyright 2004-2007 by ABCDEF Group LLC. All > > Rights Reserved. > > > The last line is some kind of signature. I have no problems uploading > > data lines from 1,2,3 to 123,456,789. > > The last line is ignored, which is OK. > > > I have 2 problems I cannot solve right now: > > 1. I need to upload the last line into some other staging table to do > > some validation, such as to match totals against my control numbers > > and to verify the date. > > 2. I need to have line numbers from the text in my target table: > > > LineNumber,Column1,Column2,Column3 > > 1,1,2,3 > > 2,4,5,6 > > (snip) > > 300,123,456,789 > > > I think there should be a transformation to add line numbers, but I > > cannot find any so far. > > > Thanks in advance. BTW, am I asking in the correct newsgroups?- Hide quoted text - > > - Show quoted text - Allan, Is your solution similar to the following: http://support.microsoft.com/kb/908460 If yes, I have a concern: MSDN says "The mycount column does not necessarily reflect the actual row number in the original source." Does your solution provide a reliable way of numbering lines in a text file? TIA
Don't see what you're looking for? Try a search.
|