![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
#3
| |||
| |||
|
|
Per, Try this. Create a table with a numeric column for row enumeration. Have a global variable initialized with 1 before extract starts. Extract the file using data pump. Assign the variable to the enumeration column and increment variable in the same ActiveX transformation. Later on use enumeration to parse a record out of four consecutive rows. Ilya "Per Salmi" <per.salmi (AT) nospam (DOT) nospam> wrote in message news:OBDARt4qEHA.3520 (AT) TK2MSFTNGP11 (DOT) phx.gbl... I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
#4
| |||
| |||
|
|
I'm not sure if I understand what you mean by that. Would it end up with a temporary table where I have all the rows from the text file with the enumeration number set to the same value for each group of 4 lines? Or will it result in a table with a numbered sequence of lines that I process outside of DTS to build a record out of each group of 4 lines? /Per "Ilya Margolin" <ilya_no_spam_ (AT) unapen (DOT) com> skrev i meddelandet news:%23cdtuI6qEHA.3900 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Per, Try this. Create a table with a numeric column for row enumeration. Have a global variable initialized with 1 before extract starts. Extract the file using data pump. Assign the variable to the enumeration column and increment variable in the same ActiveX transformation. Later on use enumeration to parse a record out of four consecutive rows. Ilya "Per Salmi" <per.salmi (AT) nospam (DOT) nospam> wrote in message news:OBDARt4qEHA.3520 (AT) TK2MSFTNGP11 (DOT) phx.gbl... I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
#5
| |||
| |||
|
|
I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
#6
| |||
| |||
|
|
If it results in a new enumeration number for each line... Wouldn't it be easier to use an identity column that automatically increases by 1 in the temporary table. Still wondering about how to get 4 rows and process them into one row when the text lines are in the database... Seems hard to do it in DTS... /Per "Per Salmi" <per.salmi (AT) nospam (DOT) nospam> skrev i meddelandet news:ObEy0%236qEHA.644 (AT) tk2msftngp13 (DOT) phx.gbl... I'm not sure if I understand what you mean by that. Would it end up with a temporary table where I have all the rows from the text file with the enumeration number set to the same value for each group of 4 lines? Or will it result in a table with a numbered sequence of lines that I process outside of DTS to build a record out of each group of 4 lines? /Per "Ilya Margolin" <ilya_no_spam_ (AT) unapen (DOT) com> skrev i meddelandet news:%23cdtuI6qEHA.3900 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Per, Try this. Create a table with a numeric column for row enumeration. Have a global variable initialized with 1 before extract starts. Extract the file using data pump. Assign the variable to the enumeration column and increment variable in the same ActiveX transformation. Later on use enumeration to parse a record out of four consecutive rows. Ilya "Per Salmi" <per.salmi (AT) nospam (DOT) nospam> wrote in message news:OBDARt4qEHA.3520 (AT) TK2MSFTNGP11 (DOT) phx.gbl... I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
#7
| |||
| |||
|
|
I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
#8
| |||
| |||
|
|
OK You have an enumerator variable in your Active Script transform. Its values are 1-4 You grab the values from each row of your text file For values 1-3 you do not insert anything to the DB For 4 you can then issue an insert with the values you have accumulated over the last 4 rows of the file -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.Konesans.com "Per Salmi" <per.salmi (AT) nospam (DOT) nospam> wrote in message news:OBDARt4qEHA.3520 (AT) TK2MSFTNGP11 (DOT) phx.gbl... I am going to import a textfile from a mainframe system that is formatted with fields in fixed column positions. But there is another thing that bothers me, every record in the file is split up on four rows in the file. I want to use fields from the 4 lines and compose input for a single row in a database. Anyone out there who knows how to perform this multi-line record reading of a textfile? Or should I avoid DTS and go for a C# application because of the multi-line input records? Best regards, Per Salmi |
![]() |
| Thread Tools | |
| Display Modes | |
| |