Parsing fixed-width files
mlang
Registered Posts: 6 ✭✭✭✭
I am trying to parse a fixed-width format file, but I am getting an error when I try to enter values in the "column offsets" field. It allows me to save my settings without error, but it never generates a preview or schema. When I go back to the "Explore" tab, it gives the following error: "Failed to run". Followed by: "For input string: "2"". The number there is always the first value I put in the "column offsets" field.
I tried to included screenshots here, but the image embed button is not working for me (won't let me upload a file).
I tried to included screenshots here, but the image embed button is not working for me (won't let me upload a file).
Tagged:
Answers
-
Hi,
Here is an example value to put in the "column offsets" field:
0,3,4
Note that the first number should be 0, and that the last number must not be larger than the shortest input line. Is it adaptable to your case? -
That seems to have addressed the error. I think the problem was I had spaces in between the commas and numbers (e.g. "0, 3, 4" vs. "0,3,4").
Thanks!