KathleenR
asked on
Parse and text to columns of text file.
Hello,
The goal is to get the data into a sql table. I just need help parsing the text file into 2 columns, multi row. I don't care how they are delineated I can figure out the import side.
I have written python, t-sql and powershell so ideally the solution would use one of those tools.
The files are not large and are text files. Assume I'll need to run process once a month but not consistently.
Data between {} is one record, 2 columns. No cr at row end.
There can be any number of filenames in the text file with 0 to 30 pieces of information so empty [] is a possibility.
I want each comma separated value in information to be a new row. i want all {'': to be removed
example:Input shows 2 records
{'filename':'colors','info rmation':[ red,blue,y ellow]}, {'filename':'colors','info rmation':[ pink,orang e]}, etc.
required output for first one
filename Information
colors red
colors blue
colors yellow
The goal is to get the data into a sql table. I just need help parsing the text file into 2 columns, multi row. I don't care how they are delineated I can figure out the import side.
I have written python, t-sql and powershell so ideally the solution would use one of those tools.
The files are not large and are text files. Assume I'll need to run process once a month but not consistently.
Data between {} is one record, 2 columns. No cr at row end.
There can be any number of filenames in the text file with 0 to 30 pieces of information so empty [] is a possibility.
I want each comma separated value in information to be a new row. i want all {'': to be removed
example:Input shows 2 records
{'filename':'colors','info
required output for first one
filename Information
colors red
colors blue
colors yellow
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER