• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S 2.2.1 Data File Null Terminated Fields???

 
Chris Bicnal
Ranch Hand
Posts: 96
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm doing the final read through of everything before submitting and I've noticed that the data file is described as...
All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field.

Now, when I look at the provided data file and read a record they've padded fields with spaces (ASCII code 32) - not nulls as they have described!

Has anyone else encountered this? If so, what approach have you taken?

Thanks,

Chris


 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Chris!

Has anyone else encountered this? If so, what approach have you taken?


Yup. And here's what I did: I kept the database format, that is, I didn't use null terminators, I used empty spaces to fill the remaining positions of each field value. For instance, if a field length in the database is 64 positions, and the provided value has 50 characters, then it will be saved with the 50 characters + (64 - 50) empty spaces.
 
Roel De Nijs
Sheriff
Posts: 9934
113
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,

I did the same thing as Roberto.
And you could/should of course add something about this decision in your choices.txt

Kind regards,
Roel
 
Jari Timonen
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also use spaces instead of null terminators.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic