Gossamer Forum
Home : Products : DBMan : Customization :

I need to pad end of fields with spaces

Quote Reply
I need to pad end of fields with spaces
Basically, each of the fields in my database must have a minimum and a maximum number of text. For example, the first field must have a minimum AND a maximum of 3 characters. So if someone enters only 2 of them, the script must pad the end of the string with nulls. Basically, I need to get the input from the user and pad the end of it with spaces until it reaches the 'maxlength'.

This is because thereīs a program over here that imports database data with no delimiters, it knows what field it is by the number of chars. Like, the first filed has 3 characters, the second has 10, the third has 15, etc. So if the string is not long enough it has to be paded with spaces. And Iīll have to delete the delimiter also ('|' in my case), but that I can do in any text editor or Hex editor.

So I hope I made my problem clear, Iīd apreciate any help at all, I donīt know what else to do.

Thanks guys.