These reports are coming from quickbooks, downloaded as Excel files. Notice that the left column is this nested hierarchy based on the left spacing.
I need to separate Description column into separate columns based on the number of leading spaces on the left.
As I've been working with financial reports recently, these are super common and extremely difficult to work with. Is there a package or function for importing this type of data?
Here is example reproducible input dataframe:
df1 <- structure(list(Description = c("asset", " current asset", " bank acc",
" banner", " clearing",
" total bank accounts",
" total current assets"),
Total = c(NA, NA, NA, 10L, 20L, 30L, 30L)),
.Names = c("Description", "Total"),
class = "data.frame",
row.names = c(NA, -7L))
Col1,Col2...
or do you want to give them names?