How can I sub 1 from each element from my txt file. I had actually tried similar to  question but was not successes full.   Suppose I have file in the following format  2,4,5 1,2,3 14,12,1   Now I want the file to be  // basically subtract 1 from all  1,3,4 0,1,2   13,11,0   What I have tried so far is   $awk '{if(getline != 0){           for(i = 0; i &lt;=NF; i++){               $(i)=$(i)-1;           }        } print;}}'   I was trying to read till end of file and sub 1 from each element, but when I do this I just -1
I want to subtract a constant number from my data to get new data file. For example, I want to subtract  10 from my data.   data.txt  Id  a   b   c   d   e 1   1   2   3   4   5 2   2   3   4   5   6 3   3   4   5   6   7 4   4   5   6   7   8 5   5   6   7   8   9 6   6   7   8   9   10 7   7   8   9   10  11 8   8   9   10  11  12 9   9   10  11  12  13 10  10  11  12  13  14 11  11  12  13  14  15 12  12  13  14  15  16 13  13  14  15  16  17 14  14  15  16  17  18   Required output:  out.txt   Id  a   b   c   d   e 1   -9  -8  -7  -6  -5 2   -8  -7  -6  -5  -4 3   -7  -6  -5  -4  -3 4   -6  -5  -4  -3  -2 5   -5  -4  -3  -2  -1 6   -4  -3  -2  -1  0 7   -3  -2  -1  0   1 8   -2  -1  0   1   2 9   -1  0   1   2   3 10  0   1   2   3   4 11  1   2   3   4   5 12  2   3   4   5   6 13  3   4   5   6   7 14  4   5   6   7   8
The old "too localized" closing reason included "questions that are unlikely to help future visitors".   , that if a question resulted from a typo in the OP code those questions should be closed with "too localized" reason.  The current off-topic reason does not cover that.  Should these questions remain open now, as they do not really fall into any current closure category?  UPDATE  I marked  for diamond moderator attention to be deleted as Robert Harvey hinted below, only to get the flag declined as "declined - flags should only be used to make moderators aware of content that requires their intervention".  Can you confidently tell me that this is a useful question that helps the goal of SE? Removing an Ubuntu installation I first had windwos 7, then I installed Ubuntu alongside and when my laptop starts I can choose between ubuntu and windows (the ubuntu boot screen) .  Now I have installed another ubuntu inside the windows 7 using virtual box. I want to remove that first ubuntu installation and free up its partiotion. Can I do it without making any problems for the windows and boot screen? Hibernate: comparing current & previous record I want to compare the current value of an in-memory Hibernate entity with the value in the database:  HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id); // CODEBLOCK#1 evaluate differences between newEntity and oldEntity sess.update(newEntity);       In CODEBLOCK#1 I get that newEntity.getProperty()="new value" AND oldEntity.getProperty()="new value" (while I expected oldEntity.getProperty()="old value", of course). In fact the two objects are exactly the same in memory.  I messed around with HibernateSessionFactory.getSession().evict(newEntity) and attempted to set oldEntity=null to get rid of it (I need it only for the comparison):  HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); HibernateSessionFactory.getSession().evict(newEntity); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id); // CODEBLOCK#1 evaluate differences between newEntity and oldEntity oldEntity = null; sess.update(newEntity);   and now the two entities are distinct, but of course I get the dreaded org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session.  Any idea?  EDIT: I tried the double session strategy; I modified my HibernateSessionFactory to implement a map of session and then...  Session session1 = HibernateSessionFactory.getSession(SessionKeys.DEFAULT); Session session2 = HibernateSessionFactory.getSession(SessionKeys.ALTERNATE); Entity newEntity = (Entity)entity; newEntity.setNote("edited note"); Entity oldEntity = (Entity)session1.load(Entity.class, id);  System.out.println("NEW:" + newEntity.getNote()); System.out.println("OLD: " + oldEntity.getNote()); // HANGS HERE!!!  HibernateSessionFactory.closeSession(SessionKeys.ALTERNATE);   My unit test hangs while attempting to print the oldEntity note... :-( Smooth transition between two materials Building a graph from OSM? I spent days looking in all questions here and trying tutorials. I need to build a graph for a region (It will be my input in simulation) I downloaded Postgresql and Postgis and osm2pgsql. Now i can load .osm files into a database. I want to have a complete database with roads ids so i can generate a table of edges and nodes then build my graph  nodes = intersections and edges = roads for a city using python.  Please any detailed help with steps.I saw a lot of keywords (Postgresql/postgis, Networkx, QGIS ..) but i couldn't manage to assemble a good tutorial  I am a very beginner. I would like to count the number of unique selections from a column that contains multiple selections from a drop down list.  For example, column B3 contains,     Monday, Tuesday, Wednesday   The count function returns a value of 1 instead of 3 - is there any way to count the three days distinctly? Thank you!  Multiple selections from a drop down list was made possible using the VBA code from: Spoilers for A Storm of Swords / Season 4 episode 2 "The Lion and the Rose".  At the Purple Wedding,      Littlefinger and Lady Olenna Tyrell   perform their plan of      poisoning King Joffrey.   A short summary of their plan:  Littlefinger orders Ser Dontos Hollard to give Sansa Stark a beautiful silver hairnet adorned with amethysts. At least some of the amethysts are actually strangler crystals in disguise. Ser Dontos also, still under orders of Littlefinger, urges Sansa to wear the hairnet at the wedding, which she then does. At the wedding, when Lady Olenna greets Sansa, she fusses her hairnet a bit, while secretly taking one of the strangler crystals. Later, during the wedding, Lady Olenna puts the crystal in Joffrey's royal cup, poisoning him.  But why was their plan so complicated? Why couldn't Lady Olenna just bring a strangler crystal with her to the wedding (as suggested in )?  Then they wouldn't depend on Ser Dontos and Sansa who could unknowingly have done something to prevent the success of the plan.  The only reason that I could think of, is Littlefinger and Lady Olenna plan for Sansa (and Tyrion as her husband with her) to take the blame for Joffrey's death.  They put the crystals on her person, so that upon examination it would clearly show that Sansa had the murder weapon on her. But Littlefinger had a plan he did not tell Lady Olenna, namely rescuing Sansa during the chaos ensuing the murder (and thereby leaving Tyrion behind as the only accused).  Is there anything confirming or debunking this theory? If my theory doesn't hold up, is there another explanation for why the plan was so needlessly complicated? Blank lines in an equation and some other similar function Why blank lines between equation makes error? there are a lot of commands in latex and almost for all of them these blank lines are not important,  but why in this case is important and is there any similar function? Finding acute triangle probability A stick is broken in three parts of any length ,  if we join the pieces then what's the probability of getting a acute angled triangle? Define a mathematical set How did Bill and Percy get 12 OWLs? In Prisoner of Azkaban, Hermione took 12 subjects, and needed a Time-Turner to do so. However, it is mentioned in the series that both Bill and Percy Weasley got 12 OWLs, so would have taken 12 subjects as well, so both would have needed Time-Turners for three years to do this. Doesn't this seem a little unusual, given how strict the Ministry is over the use of Time-Turners,  that they would give them to several Hogwarts students? I can't think of a decent reason to allow editing audit messages (like  or ). I have abused it for fun before but it really has no purpose other than joking or obfuscating your actions. For that I think that such messages should be untouchable. Please make them so. How can I easily switch audio output in Ubuntu 17.10 and later with GNOME? Let $f$ be an analytic function such that $\operatorname{Im}(f(z))=\operatorname{Re}(f(z))^2$. Prove that $f$ is constant. How to solve this question? Also it would be great if someone could tell me from which book this question is from? What are the colored/highlighted edges in edit mode? There are red and pink edges on my mesh.  What do these colored edges mean? How can I use them? Let $ P(x)=x^8 - x^7 +x^2 -x +15 $, Descartes' Rule of Signs tells us that the polynomial has 4 positive real roots , but if we group the terms as $$ P(x)= x(x-1)(x^6+1) +15 $$ we find that $ P(x) $ does not have any positive roots.  Where did I err ? How to execute several commands after each other with one request to the terminal (without using a file)? TeX editor with line-spacing preferences Do I need a transit visa for a layover in the United Arab Emirates? Trash icon and files have disappeared from the desktop after upgrade to Ubuntu 19.04 Yesterday I upgraded my Ubuntu 18.10 to Ubuntu 19.04, and after the restart, the trash icon and my Desktop files have disappeared from the UI. If I go to the Desktop folder from my personal folder, I can see the files, but my Desktop is empty.  How can I show my files in the Desktop again?