afilina,
@afilina@phpc.social avatar

Shout out to league/csv for continuing to be an awesome library. It's intuitive, a breath of fresh air after a long week of fighting every single tool. This one doesn't fight you. It just helps you without getting in the way.

SuitedUpDev,
@SuitedUpDev@mastodon.online avatar

@afilina Everytime I need to use something CSV files, I always use league/csv. It's sooo comfy and works flawless.

Synchro,
@Synchro@phpc.social avatar

@afilina Unless you’re trying to check whether you’ve got to the end of the file; that’s apparently out of scope.

cabbey,
@cabbey@phpc.social avatar

@afilina oooh! I didn't know this package existed. I think pretty much every package from The League I've used has fit this description though, so that's a good sign. Sadly, after looking at it's docs, it doesn't even attempt to solve the biggest problem I think @kboyd and I see with writing csv files... managing the column positions when you have variable data. :(

afilina,
@afilina@phpc.social avatar

@cabbey @kboyd What do you mean "variable data"?

cabbey,
@cabbey@phpc.social avatar

@afilina @kboyd say you have 50 columns... say 40 of them are populated in every row, but the other 10 you get some random subset (depending on what the other values maybe, you may have 10 of them or you may have 3 of them or somewhere between.) Then say you have another 6 or so columns that get added for certain customers but not for others.
It would be awesome if you could give it a header array and then pass in a hash for the row and have it populate just the ones that are set.

kboyd,
@kboyd@phpc.social avatar

@cabbey @afilina seems like this csv lib would be a good foundation for building a solution for that.

cabbey,
@cabbey@phpc.social avatar

@kboyd @afilina or a patch to add it if they're open to it.

kboyd,
@kboyd@phpc.social avatar

@cabbey @afilina it does support "helpers", i wonder if that implementation is flexible enough to solve for this.

afilina,
@afilina@phpc.social avatar

@cabbey @kboyd That would be pretty useful. It's worth asking for this, as I've seen several useful new features in the last couple of years. It's actively improved.

While you wait, I think that something can be done using addFormatter where you merge your row into a default row (which has full column count).

cabbey,
@cabbey@phpc.social avatar

@afilina @kboyd ahh... I must have misunderstood what formatters could do... I thought they were processed cell by cell. If they get the whole record then yeah, that would probably work.

afilina,
@afilina@phpc.social avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • thenastyranch
  • GTA5RPClips
  • rosin
  • slotface
  • InstantRegret
  • ngwrru68w68
  • PowerRangers
  • kavyap
  • tsrsr
  • hgfsjryuu7
  • mdbf
  • tester
  • tacticalgear
  • khanakhh
  • cisconetworking
  • everett
  • Durango
  • ethstaker
  • vwfavf
  • cubers
  • normalnudes
  • osvaldo12
  • modclub
  • Leos
  • anitta
  • All magazines