3
public function obtenerColumna($delimitador='', $columna=0,
    $incluirRepetidos=false, $eliminarEspaciosAdyacentes=true,
    $filaDesde=0, $filaHasta=0)

It obtains a column from a set of records of fixed-column length, delimited by a char. You can specify if you want to include repeated records and delete trailing and leading spaces, specify a number of row from where you want to start capturing, and an ending row number.

What most concerns me is the deleting spaces thing... should it be moved to a separate function? or just manually strip them after getting these records?

2
  • The space trimming might be needed to correctly determine if values are duplicates. For example, it might be that in some use-cases "Foo", " Foo" and "Foo " should be considered as duplicates. This is hard to do if the function isn't allowed to trim the spaces. – Bart van Ingen Schenau Oct 17 '14 at 13:46
  • 1
    The function has a single responsibility -- to parse a particular data format. – kevin cline Oct 17 '14 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.