I have a JSON like text file of records with duplicate ids that look like:  {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"93" , "ST":[42,77,51,29,63]} {"ID":"73" , "ST":[21,20]} {"ID":"94" , "ST":[65,11,4]} {"ID":"77" , "ST":[87]}   I am trying to filter the duplicates and always keep the first occurrence of such a match. The field ST could be the same but also different for the records with the same id.  The output would look like:  {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"73" , "ST":[21,20]} {"ID":"77" , "ST":[87]}   A similar question has already been asked , but for this case the data file being edited was a comma separated file. Here we are dealing with a JSON data and the goal will be to find the lines that have the same id values(may be a regex match) and keep the latest one. Anyone has an idea how to tackle that with awk, sed or pure command line tools?
I have a file containing two columns and 10 million rows. The first column contains many repeated values, but there is a distinct value in column 2. I want to remove the repeated rows and want to keep only one using awk. Note: the file is sorted with values in column 1. For example:    1.123 -4.0 2.234 -3.5 2.234 -3.1 2.234 -2.0 4.432 0.0 5.123 +0.2 8.654 +0.5 8.654 +0.8 8.654 +0.9 . . . .   Expected output  1.123 -4.0 2.234 -3.5 4.432 0.0 5.123 +0.2 8.654 +0.5 . . . .
Can bug reports and feature requests requiring SE Dev attention be reported on per-site metas, or do they need to all go here? I am getting the following error in a Drupal 8 site.     The following module is missing from the file system   It looks as if a custom module was installed and deleted without uninstalling it.   How can I fix this error? How to get the current date/time in Java So basically I want to show:  $\aleph_{\alpha}^{\aleph_{1}} = \aleph_{\alpha}^{\aleph_{0}}\cdot2^{\aleph_1}$ , Where $\omega\leq\alpha&lt;\omega_1$  There is a proof that I found;    But I don't understand his proof for the limit case of $\alpha$.  To be more specific, I dont understand why $ \left( \sup_{\omega \le \beta &lt; \alpha} \aleph_{\beta}\right)^{\aleph_1} \le \left( \prod_{\omega \le \beta &lt; \alpha} \aleph_{\beta}\right)^{\aleph_1}$  Any insights or help is deeply appreciated.  Cheers What is the probability that $x_1+x_2+...+x_n \le n$? Given that $X_1, X_2...$ are mutually independent random variables. For each $i$ with $1\le i \le n$   the variable $X_i$ is equal to either $0$ or $n+1$ $E(X_i)$ = $1$   also.. if $X_i$ is equal to either $0$ or $n+1$, doesn't that mean that all $X_i$ need to be $0$?  Thanks If $ar + bs =1$, then $\gcd(a,s) = \gcd(r,b) = \gcd(r,s) = 1$ Understanding NSString comparison Im using a program called Daisy Disk to see what is taking up space in my Mac and I find that the /cores directory is taking up 77gb.   Is that a problem? Can I get rid of it to regain the space? What are the most commonly used and basic Apache htaccess redirects? I'm using a common charger for both of my laptops.  The charger is specified at 20 Volts and 3.25 Amperes. My other laptop has a specification of 19 V and 3.42 A.  Is it safe to charge my laptop with chargers whose specifications exceed or are not equal to the mentioned specifications?  I have read somewhere that it may cause some damage if the voltage or amperage is not matching the specs. How to prepare data for ListVectorPlot[]? Prove that $n$ is a sum of two squares? Problem   Let $n = p_1.p_2.p_3 \cdots p_k.m^2$, where $p_1, p_2, p_3 \cdots p_k$ are distinct primes. Prove that n is sum of two squares if and only if $p_i$ is either 2 or $p_i \equiv 1 \pmod{4}$   For $p_i = 2$ , this is trivial case since $2m^2 = m^2 + m^2$. For $p_i \equiv 1 \pmod{4}$, I tried to use the fact that the product of a number of the form $4k + 1$ is also in this form. So I come up with: $$n = (4k + 1) \cdot m^2 = 4km^2 + m^2$$ Apparently, $m^2$ is a square, but I could not figure out how to prove $4km^2$ is a square, since k is in unknown form. Any idea?    Thanks, How to get to the GRUB menu at boot-time? What is the best way to clone/deep copy a .NET generic Dictionary? How could I select one vertex from my mesh if I know ID of that vertex? I enabled bpy.app.debug = True and I can see all IDs but cant find a specific one. First, a word about the format - I don't know whether this was a movie or a TV series, b/c I saw it aired in pieces on PBS back in the 1980s. I don't even recall if it was originally voiced in english, dubbed over, or subtitled. I'll just call it a movie for now.  The movie seemed to be set in Europe in what looked like the 1960's or 70's, where almost all the people were gone. The protagonist was probably a 20-something man, who routinely visited a psychiatrist. I think the protagonist also had a girlfriend, but most of the dialogs seemed to be between the man and the doctor.   It was kind of a mystery where all the people had gone, and I think the man was nominally seeing the doctor to cope with the stress of it all, or had amnesia and suspected he knew The Truth. However, it turns out that the doctor discovers that the man is somehow the key to the reality that the characters share, and during hypnosis sessions, discovers he can manipulate the man and thereby reality. To make it easier for himself, the doctor gives the man a code word to return the man to a hypnotic trance on command. The code word, I am positive, was 'Antwerp'.  I don't think I ever saw the end of this, but the 'truth' might have been that World War III was fought with neutron bombs, and that the man was actually just dreaming everything as he wandered around the city, dying. Or not. It would be nice to know how it turned out, but I don't even have the name of the show. Ever since I upgraded to 13.10, the software updater does not show all the available updates. Some will appear and can be installed just fine, but once it claims that all software is up to date, using sudo apt-get upgrade shows that there are still more packages waiting to be updated. I can update them via the command line, but that only solves things temporarily. I'm not sure why some show up and others don't. How can I make Update Manager update all packages?  Update-manager shows this:    But apt-get shows this:   Thanks! If $ \operatorname{Tr}(M^k) = \operatorname{Tr}(N^k)\;\forall 1\leq k \leq n$, then how do we show the $M$ and $N$ have the same eigenvalues? Change array key without changing order Why do only Hobbits use a combination of first- and last names? While all the Hobbits I can think of have a combination of first- and lastname (e.g., Bilbo Baggins, Peregrin Took, the Sackville-Baggins's,...), I can't think of any character* of another race that has a lastname:   Men seem to like to add a reference to their ancestors (e.g., Aragorn, Arathorn's son or Isildur's heir) Dwarves seem to like descriptive or honorary names (e.g., Thorin Oakenshield, Dain Ironfoot). They are not lastnames though, since they do not get passed on to descendants. Elves don't have a need for lastnames, since elvish names are unique. Some nevertheless seem to have an additive (e.g., Legolas Greenleaf). Likewise, I can't find any usage of lastnames among Ents, Eagles, Istari, Orcs, trolls,...   But why would a society that is quite rural and not a leader of modernization be the only one to use a modern naming system with first- and lastnames?  *Except for Tom Bombandil. But he is, well, "special".