forcewake / FlatFile

FlatFile is a library to work with flat files
MIT License
106 stars 39 forks source link

Truncate a "Fixed Length" content when it exceeds the Length property value #27

Closed cristianoalvesdasilva closed 8 years ago

cristianoalvesdasilva commented 9 years ago

Hey! First off, very good library my friend! :) Well, I have a request/observation and I'm not sure if this is the right place to do it, but here it goes: A "Fixed Length" field by definition should not violate its length, either you pad it with something or you truncate it in order to achieve the expected length...however the current code is allowing strings with larger values to go through :(

Class: FlatFile.FixedLength.Implementation.FixedLengthLineBuilder Method: TransformFieldValue Block: if (lineValue.Length >= field.Length) { return lineValue; }

Can this be changed? :)

Thanks!

forcewake commented 9 years ago

Hello @cristianoalvesdasilva Please excuse my long silence - I was on vacation. I will look into the issue and come back to you as soon as possible.

cristianoalvesdasilva commented 9 years ago

Thank you :)

forcewake commented 8 years ago

Similar to #36 Fixed in (https://github.com/forcewake/FlatFile/pull/39). Thanks to @Nezumi-Quasar