I have a file (example shown below) that has multiple CSV tables. This file is uploaded to a database. I would like to do some operations on this file. For that, I was thinking of using pandas to read each table into a separate dataframe using read_csv function. However, going through the documentation, I didn't see an option to specify a subset of lines to read/parse. Is this possible? If not, are there other alternatives?
Sample file:
TABLE_1
col1,col2
val1,val2
val3,val4
TABLE_2
col1,col2,col3,col4
val1,val2,val3,val4
...
...
I can do an initial pass through the file to determine the start/end lines of each table. However, one of read_csv arguments is "filepath_or_buffer", but I am not totally certain what the 'buffer' part is. Is it a list of strings or one big string or something else? What can I use for a buffer? Can someone point me to an small example that uses read_csv with a buffer? Thanks for any ideas.
read.csvusing theskipandnrowarguments. First step is to runreadLinesand find the gap between tables. Helps if there is some consistency.