Laravel excel : remove extra space from file header and values

Published 9 months ago by somnathsah


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,

9 months ago (151,880 XP)

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.

9 months ago (255,120 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 :

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

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