I have a data.txt
file which I want to convert to a data.json
file and print a nice first 2 entries (data.txt
contains 3 unique IDs).
The data.txt
can oublicly found here (this is a sample - original file contains 10000 unique "linkedin_internal_id
).
I tried the following:
with open("data.txt", "r") as f:
content = f.read()
data = json.dumps(content, indent=3)
This code doesn't print the appropriate JSON
format of data.txt
(it also includes \\
). Also, my jupyter notebook
gets stacked because of the large file size, for this, I want to nicely print only the first 2 entries.