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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Text will ignore blank fields at end of line

Status
Not open for further replies.

xicana

Technical User
Dec 11, 2003
100
US
Having the same export issue as the last post in thread768-800893.

Thanks to the various threads I was able to find on here regarding exporting to fixed width multiple line files I able to get date exported (including lines of up to 300 characters) in a fixed width format.

My issue is that the last field on a line is usually padded with spaces at the end in order to make sure the line is 320 characters long. However, the spaces at the end of the line are being "dropped" and the resulting text file has the lines stopping at the last printed character of the last field.

Does someone have a solution for exporting spaces at the end of the line?

This is what I'm currently using to assure that each field is a fixed width:

Code:
stringvar SubmitterID:= {@TAXID};


// Specify the desired length of the field in characters 
numbervar requiredlength:= 16; 

// Get the current length of the database field. 
numbervar currentlength:= length(SubmitterID); 

// Check the length of the database field compared to the required length 
if requiredlength < currentlength then 

// truncate fields which are longer than the required length 
SubmitterID[1 to requiredlength] 

else 
// pad the field length with spaces
SubmitterID + replicatestring(" ", requiredlength-currentlength)



Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top