I have file as follows:
I want to create separate dataframes when there is \n present. The value above the \n will be the header of that specific dataframe. I checked for a solution here but it works in different way. Any help appreciated. Thanks
file1.txt
10C.vcf
Allele
Consequence
IMPACT
SYMBOL
Gene
Feature_type
Feature
1P1.vcf
Allele
Consequence
IMPACT
SYMBOL
Gene
Feature_type
Feature
13C.vcf
Allele
Consequence
IMPACT
SYMBOL
Gene
Feature_type
Feature
40C.vcf
Allele
Consequence
IMPACT
SYMBOL
Gene
Feature_type
Feature
Expected output from the data:
df1
   10C.vcf
0  Allele
1  Consequence
2  IMPACT
3  SYMBOL
4  Gene
5  Feature_type
6  Feature
df2
   1P1.vcf
0  Allele
1  Consequence
2  IMPACT
3  SYMBOL
4  Gene
5  Feature_type
6  Feature
df3
   13C.vcf
0  Allele
1  Consequence
2  IMPACT
3  SYMBOL
4  Gene
5  Feature_type
6  Feature
df4
   40C.vcf
0  Allele
1  Consequence
2  IMPACT
3  SYMBOL
4  Gene
5  Feature_type
6  Feature
I want to create separate dataframes when there is \n present. The value above the \n will be the header of that specific dataframe. I checked for a solution here but it works in different way. Any help appreciated. Thanks
 
    