Laravel excel : remove extra space from file header and values

Published 6 months ago by somnathsah

Hi,

I am using Laravel excel package to read excel file. I want to know, does it provide any method which I can use to remove extra spaces from all header and values of the file? I don't want to use function like trim for each rows.

Thanks in advance,

Dry7
Dry7
6 months ago (151,680 XP)
somnathsah

Thanks @Dry7, Yes I saw this earlier, this is good solution. But is there anything which I can add in config of excel or direct call any method on my reader object to remove the extra spaces from header and values.

ohffs
ohffs
6 months ago (244,770 XP)

Don't know if it's any help, but I wrote a little wrapper around Spout to import & trim data seeing as I did it so often : https://github.com/ohnotnow/simple-spout

$data = (new ExcelSheet)->trimmedImport('/tmp/spreadsheet.xlsx');

Please sign in or create an account to participate in this conversation.