add method to split text into columns
Overview
Add method to split text from a single column into multiple columns.
Details
The api provide a way to split text from a single column into multiple columns: sheet API v4
This will be very useful when importing text into a worksheet and then splitting it into columns (like from a csv data source)
expose necessary methods to split text into columns.
Hi @lavigne958.. I would like to work on implementing this feature. Here's my approach:
- Adding a
DelimiterTypeStrEnum inutils.py. - Adding a
text_to_columnmethod inWorksheetclass... something like this...
@cast_to_a1_notation
def text_to_column(
self,
source_range: str,
delimiter_type: DelimiterType = DelimiterType.comma,
custom_delimiter: Optional[str] = None,
) -> JSONResponse:
Maybe for csv the usage will be like...
worksheet.text_to_column("A1:A4", DelimiterType.comma)
I have a working implementation ready. Would you like me to proceed with the pull request?
@jiisanda thanks for the thorough explanation !
we don't have much active coding right now from maintainers, but if you would like to implement this feature, go ahead and I will try to review it !
see the contributing guide: https://github.com/burnash/gspread/blob/master/.github/CONTRIBUTING.md
it would be good if there were a test created :]