I have to extract data from multiple folders. Each folder can have multiple text files.
Text files can have multiple rows. If multiple rows are there there would be possibility of each row can have different number of columns like below:
File Name: Product-ABC.txt (Prefix "Product" would be common for all files in folders)
- Data Sample:
xyzrryyywe # **Root, Column2 : 00-1234, Column3: No, Column4: Yes, Column5: 55, Column6: 07/17/19
aaauuuuye # Transfer, Column5: 88, Column6: 07/18/19
xyzrryyywe # Secure, Column2 : 00-12gfr-04, Column5: 8, Column6: 07/19/19
ttyyyyyywe # Root, Column2 : 00-134, Column3: No, Column4: Yes, Column5: 34, Column6: 04/17/19**
Each row column name and data included.
- Now I have to split column name and data first
- then have to handle inconsistent data columns for each row. (Each row either would be Root, Transfer or Secure as in above sample) There can be multiple Root rows, same for transfer and root rows. They can be multiple times
I know I have to use some script to handle inconsistent columns in file. I am confused how can I separate column names and data from rows and put it dynamically.
Please advised me how should I proceed.
Thanks Ritesh

