Is there a way in which I can populate the Fixed width file with Varchar and Integer fields padding them with space beyond their length?
It seems stupid, but if there is a way, I would be able to save a lot of stages.
Thanks in advance,
Ajith
Fixed Width File
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
Fixed Width File
you can use a transformer to pad your varchar or integer columns with spaces:
you have to use the function PadString it's very simple to use, for exemple if your have a varchar(10) column C and you got "abc" in this column if you want to pad C with 7 spaces:
PadString(C,' ',10-Len(C)) --> rignt padding
or
PadString('',' ',10-Len(C)) --> left padding.
good luck
you have to use the function PadString it's very simple to use, for exemple if your have a varchar(10) column C and you got "abc" in this column if you want to pad C with 7 spaces:
PadString(C,' ',10-Len(C)) --> rignt padding
or
PadString('',' ',10-Len(C)) --> left padding.
good luck
Thanks for all the replies.
I am currently defining every column as char and converting each and every column to char, I was just wondering, if i can avoid these conversions that would be very helpful.
There is no way to write a Varchar directly without using a modify or transformer to a fixed width file?. I was just trying to minimize the use of those stages (modify and transformer).
Thanks in advance,
Ajith
I am currently defining every column as char and converting each and every column to char, I was just wondering, if i can avoid these conversions that would be very helpful.
There is no way to write a Varchar directly without using a modify or transformer to a fixed width file?. I was just trying to minimize the use of those stages (modify and transformer).
Thanks in advance,
Ajith
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: