Posts

Showing posts with the label parsing

Parse JSON in Swift 24hours of problems

Parse JSON in Swift 24hours of problems I am really struggling to parse a json file into my iOS app in Swift. I have a JSOn output from an SQL db. I think the formatting is wrong and the data headers are a bit ambiguous but my developer who I hired to create the process is happy with the output. Link below. So in the last 3 days I have read all of the Apple Developer materials on parsing JSON, also watched numerous tutorials which all cover pretty much the same data, and I don't know how much I have read and converted into actual projects which have all failed. I am really needing some guidance here. I have even in a desperate attempt to understand my problem from a different perspective I have looked at how it is done in other languages. This is the latest iteration: func flightData()-> [[String: String]]{ let url = URL(string: "http://35.237.114.234/api/index.php?uid=Bx7faf08A9fYJ7bZCNMUX9EzxYN2") guard let jsonFileURL = Bundle.main.url(forResource: "jso...

How to get a JSON unique field's name and deeply nested child field's value in Golang?

How to get a JSON unique field's name and deeply nested child field's value in Golang? I have a json file that looks like this { "links": { "uniqueurl_1": { "a": { "b": [ "stuff" ], "I": { "want": { "to": "morestuff", "go": { "in": { "here": { "and": "array", "itis": { "very": "string", "deep": "stringIwant" } } } } } } } } } } And I want to get the uniqueurl_1 (that is always different for each link), and I also want to get the "deep" field's value ("stringIwant") uniqueurl_1 I know if it's ...

Perl compatible regular expression (PCRE) in Python

Perl compatible regular expression (PCRE) in Python I have to parse some strings based on PCRE in Python, and I've no idea how to do that. Strings I want to parse looks like: match mysql m/^.n(4.[-.w]+).../s p/MySQL/ i/$1/ In this example, I have to get this different items: "m/^.n(4.[-.w]+).../s" ; "p/MySQL/" ; "i/$1/" The only thing I've found relating to PCRE manipulation in Python is this module: http://pydoc.org/2.2.3/pcre.html (but it's written it's a .so file ...) Do you know if some Python module exists to parse this kind of string? Just to be clear: You want to match PCREs, not use them? – Tim Pietzcker Aug 15 '11 at 9:37 I have to use them – Steeve Aug 15 '11 at 9:41 ...