Hello! Looking for a few suggestions as I am just dusting off my old COBOL skills.
I'm inputting a file that is created manually from another application and saved as a ".csv" file. The records are variable in length (although I just defined fields as I know the max field length for each field in the record). Since it is a CSV file I was thinking I could just unstring it. However, a few of the fields are just user input text. So a lot of extra spaces, carriage returns, commas, etc. I removed the commas and just replaced with spaces and while that helped some, there still a lot of missing data on the output file.
I'm thinking my approach is flawed. If I read the record in as variable length record would that be a better approach? I'm still not sure I solved the problem of when I view the CSV file in Excel and I'm looking at a certain cell, it is not a continuous record of text. For example, a cell in the CSV file might look something like:
Amy Smith Anytown
OH 55255 This customer did not complete the required fields.
vs a cleaner look:
Amy Smith Anytown OH 55255 This customer did not complete the required fields.
Any suggestions on a different approach of dealing with less than perfect input file formats?
Thanks in advance.
I'm inputting a file that is created manually from another application and saved as a ".csv" file. The records are variable in length (although I just defined fields as I know the max field length for each field in the record). Since it is a CSV file I was thinking I could just unstring it. However, a few of the fields are just user input text. So a lot of extra spaces, carriage returns, commas, etc. I removed the commas and just replaced with spaces and while that helped some, there still a lot of missing data on the output file.
I'm thinking my approach is flawed. If I read the record in as variable length record would that be a better approach? I'm still not sure I solved the problem of when I view the CSV file in Excel and I'm looking at a certain cell, it is not a continuous record of text. For example, a cell in the CSV file might look something like:
Amy Smith Anytown
OH 55255 This customer did not complete the required fields.
vs a cleaner look:
Amy Smith Anytown OH 55255 This customer did not complete the required fields.
Any suggestions on a different approach of dealing with less than perfect input file formats?
Thanks in advance.