New line character
Moderators: chulett, rschirm, roy
New line character
I have a job that prepares a sequencial file as
Total_Data_Count File_Count Filter_Count
100 10 20
is there a way that I can modify the sequencial file to as
Total_Data_Count,100
File_Count,10
Filter_Count,20
Total_Data_Count File_Count Filter_Count
100 10 20
is there a way that I can modify the sequencial file to as
Total_Data_Count,100
File_Count,10
Filter_Count,20
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi qutesanju,
You may try the below-
1.In stage variable of the transformer-
2. In derivation-
Execute the transformer stage in sequential mode.
3.In the Filter option of the sequential file stage-
You may try the below-
1.In stage variable of the transformer-
Code: Select all
SV1:",":col1 SV1 (initilize with null)
SV2:",":col2 SV2(initilize with null)
SV3:",":col3 SV3(initilize with null)
Code: Select all
SV1:"|":SV2:"|":SV3 outputcol
3.In the Filter option of the sequential file stage-
Code: Select all
tail -1 | tr -s '|' '\n'
Hi cutesanju
As Craig said if you drop the headers then a little change in the previous code-
In derivation, instead of this
The other things will remain same.
As Craig said if you drop the headers then a little change in the previous code-
In derivation, instead of this
Use the below-SV1:"|":SV2:"|":SV3 outputcol
Code: Select all
Total_Data_Count:SV1:"|":File_Count:SV2:"|":Filter_Count:SV3 outputcol
Of course, there are other games you can play. You could build and write out a single record much as posted but rather than the pipes separate the three segments with a line feed. You'll write out one record but anything reading it will read three:
Again, make sure to not enable column headers while writing.
Code: Select all
svLF = CHAR(10)
Output = 'Total_Data_Count,' : Col1 : svLF : 'File_Count,' : Col2 : svLF : 'Filter_Count,' : Col3
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers