Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixed text field export with character spacing 2

Status
Not open for further replies.

socalvelo

Technical User
Jan 29, 2006
127
0
16
US
CR2011
SQL db

I need to export a text field for use in a CSV file that is fed into another databae. It needs to be 38 characters. Easy enough using left({Permit_Main.DESCRIPTION},38)

However I need to fill in with character spaces if the field has less than 38 text characters.

Can someone help with a formula that will give me 38 characters and spaces with or without 38 text characters. The spaces would fill the gap to the next field in my CSV file.
 
nice one Charliy
I usually use {TABLE.FIELD}& space(38-len({TABLE.FIELD}) but I will use yours from now on

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Thank you for the help. It works great.
 
Be sure and click the star for Charliy for Great Post... That way others will know this question has been resolved.

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
BTW ...

Comma
Separated
Values

...is what CSV means.

So your file is Fixed Width, not CSV, probably needed as input for a COBOL program or the like, to a mainframe system.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Skip,

Thanks for clarifying that for me. I erroneously was using CSV as a general term.
My export indeed needs to be just a text file full character spacing only.
 
I have to do a lot of fixed length files so I set that up as a User Defined Function. Now I can just say
EXACTLY({table.field},38)
and it gives me that same result.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top