Question: How to remove complete record of same object in array please help me this, I am using below funtion but its only remove one value I want remove complete object of same object

```
var data = [{
    "QuestionOid": 1,
    "name": "hello",
    "label": "world"
}, {
   "QuestionOid": 2,
    "name": "abc",
    "label": "xyz"
}, {
   "QuestionOid": 1,
    "name": "hello",
    "label": "world"
}];

    function removeDumplicateValue(myArray) {
                    var newArray = [];

                    $.each(myArray, function (key, value) {
                        var exists = false;
                        $.each(newArray, function (k, val2) {
                            if (value.QuestionOid == val2.QuestionOid) { exists = true };
                        });
                        if (exists == false && value.QuestionOid != undefined) { newArray.push(value); }
                    });

                    return newArray;
                }

```

I want result like this

```
[{
   "QuestionOid": 2,
    "name": "abc",
    "label": "xyz"
}]

```

Answer: 
Your question seems to imply that "tokenizing" is some kind of mysterious and complicated process. But in fact, the thing you are trying to do is exactly *tokenizing*.

Here is a perfectly valid way to read the file you show, break it up into tokens, and store it in a data structure:

```
def read_file_data(data_file_path):
    result = {}
    with open(data_file_path) as data_file:
        for line in data_file:
            key, value = line.split(' ', maxsplit=1)
            result[key] = value
    return result

```

That wasn't complicated, it wasn't a lot of code, it doesn't need a third-party library, and it's easy to work with:

```
data = read_file_data('path/to/file')
print(data['Nom'])  # prints "NMS-01"

```

Now, this implementation makes many *assumptions* about the structure of the file. Among other things, it assumes:

* The entire file is structured as key/value pairs
* Each key/value pair fits on a single line
* Every line in the file is a key/value pair (no comments or blank lines)
* The key cannot contain space characters
* The value cannot contain newline characters
* The same key does not appear multiple times in the file (or, if it does, it is acceptable for the last value given to be the only one returned)

Some of these assumptions may be false, but they are all true for the data sample you provided.

More generally: if you want to parse some kind of structured data, you need to understand the structure of the data and how values are delimited from each other. That's why common structured data formats like XML, JSON, and YAML (among many others!) were invented. Once you know the *language* you are parsing, *tokenization* is simply the code you write to match up the language with the text of your input.
Pandas does many magical things, so maybe that is prettier for you?

```
import pandas as pd

pd.read_csv('input.txt',sep = ' ',header=None,index_col=0)

```

This gives you a dataframe that you can manipulate further:

```
0       1
Nom     NMS-01
MAC     AAAAAAAAAAA
UDPport 2019
TCPport 9129

```