Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSubKeyMap #37

Closed
lorie131 opened this issue Feb 8, 2017 · 10 comments
Closed

getSubKeyMap #37

lorie131 opened this issue Feb 8, 2017 · 10 comments

Comments

@lorie131
Copy link

lorie131 commented Feb 8, 2017

There seems to be a couple issues with this function.

Getting a runtime error: index out of range [recovered]
First the switch is on the length of the split string. If the length of the string array is 3 (case 3), then you can't reference vv[3] which would be the 4th element right? It must be vv[2] to access the third string.

Second, if your text has any ":" in it, it will get confused. My text had a "http://blah/blah/blah" in it. So, after I made the above change, I got the error: "unknown subkey conversion spec:..."

Basically I was trying to read in a kml file, change the description and name fields and then print it back out. I was trying to use the
paths= PathsForKey("description")
values =ValuesForPath(paths[0]).
UpdateValuesForPath(newVal, path[0], "description:"+value[0])
with a double loop in there to get all the paths and values. But, because description can have any kind of text, this will not be possible. Is there a better way of doing this?

Thanks,
Lorie

@clbanning
Copy link
Owner

Please send or post in gist an example of the data and code you're looking at.

@clbanning
Copy link
Owner

clbanning commented Feb 8, 2017

I can provide a patch to address part 1 of your issue. The second part is one I need data for.

@lorie131
Copy link
Author

lorie131 commented Feb 9, 2017 via email

@clbanning
Copy link
Owner

Can't email attachment to GitHub issue thread - please send directly to clbanning@gmail.com

clbanning pushed a commit that referenced this issue Feb 9, 2017
@clbanning
Copy link
Owner

Part 1 is at tip. Waiting on your zip file.

@clbanning
Copy link
Owner

Please confirm that SetSubkeyFieldSeparator and SetNewvalFieldSeparator on tip address this issue.

@lorie131
Copy link
Author

lorie131 commented Feb 10, 2017 via email

@clbanning
Copy link
Owner

clbanning commented Feb 10, 2017 via email

@lorie131
Copy link
Author

lorie131 commented Feb 10, 2017 via email

@clbanning
Copy link
Owner

clbanning commented Feb 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants