Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Get the n th item in array #163

Open
sign0 opened this issue Sep 2, 2018 · 2 comments
Open

Get the n th item in array #163

sign0 opened this issue Sep 2, 2018 · 2 comments

Comments

@sign0
Copy link

sign0 commented Sep 2, 2018

Hi !

Do you have a method to retrieve a specific item in an array ?
Example : get the 200'042 th element from an array of 256'000 items.

[
    {"header":{...},"data":[......]},
    {"header":{...},"data":[......]},
    ......
    {"header":{...},"data":[......]}, <-- TARGET
    ...
    {"header":{...},"data":[......]},
]

Thanks

@sign0 sign0 changed the title Get one item in array Get the n th item in array Sep 2, 2018
@Poetro
Copy link

Poetro commented Sep 2, 2018

Since JSONStream gives you a stream of items, you will have to process all, and throw away the unwanted items. Maybe keep a counter of the items processed, so you will know which ones you need to keep.

@sign0
Copy link
Author

sign0 commented Sep 2, 2018

Yes, that's already what I do. But it's very slow in my case and I wondered if it was possible to do otherwise. I will rather try with bash commands to see if it's possible.

Thanks

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

No branches or pull requests

2 participants