I am trying to create a tool that reads multiple CSVs from a folder and converts them into xlsx. My problem is that in some variables there are leading zeros that I want to keep. But the variable names vary between files and also every time I will need this tool.
So, is there a way to automatically detect leading 0s in any variables when at reading a file with read.csv()?
I cannot apply formats after reading because I will not fully know the variable names in which I need to apply this. I cannot force every column to turn into text because I have other variables that need to be a number.