I try to modify one column of my file, then print the result.  awk -F"|" '{ if(NR!=1){$5 = $5+0.1} print $0}' myfile   It does what I want, but when printing, only the first line keeps its field separator.( the one, i don't modify).  So I could use print $1"|"$2"|"$3"|"$4"|"$5"|"... but isn't there a solution using $0 ? (For example if I don't know the numbers of column)  I believe, I could solve my problem easily with sed, but I try to learn awk for now.
I have a file with values organized in columns, and separated by commas, as in the file below:   324,01,1,113333600000,1,, 016,01,1,134954200000,1,, 770,01,1,109069200000,1,, 853,01,1,111518800000,1,,   When I use the following awk command, the delimiter is being changed from commas to spaces   Code:  awk -F, '{$4=$4/1024}{print $0}'   The output becomes:   324 01 1 110677343.75 1   016 01 1 131791210.93 1   770 01 1 106512890.62 1   853 01 1 108905078.12 1    How can I change the value of the field without changing the delimiter?
Say that I have a vertical thermally insulated cylinder which contains an ideal monoatomic gas under a weightless piston and the system is initially in equilibrium.   Now if a load of weight $W$ is kept on the piston,the piston would fall by some distance and the system would attain a new equilibrium. It is intuitive that the sum of the work done by gravity and the work done by atmospheric pressure would change into internal energy of the gas.   However, my book mentions that only the work done by gravity goes into the increase in internal energy of gas. It does not say anything about where the atmospheric work would go. Why is it so? I want to copy/modify/delete a Minecraft world. Where can I find my saves folder? I have a login called user1. user1 can execute stored procedure [Test].[SP1]  EXEC [Test].[TestSortation] EXEC [TestSortation]   Both of the above commands work.  Now if I give the user1 the server role of sysadmin in addition to public. the later of the 2 statements above fails, and throws this error:     Could not find stored procedure 'TestSortation'.   I don't want to have to change every stored procedure in the database to have the schema name included with EXECute commands manually. Can someone explain to my why this is happening. Also, is there a way to get around this, automatically fix my stored procedures, have the schema default to [Test]? Typesetting 144...4 with "n times" under the 4's is easy, but what about \sqrt{144...4}? At the end of The Return of the King, Frodo, Bilbo, Gandalf, Elrond, and Galadriel left Middle-earth on a ship, along with other elves. I named those five because they were all ringbearers and it seems to be a common trait. Frodo and Bilbo bore the One Ring and the three others bore the three elven Rings.  Why did they have to do that? Why didn't they stay and have a peaceful life now that the Dark Lord was gone? According to the special theory of relativity, distant simultaneity depends on the observer's reference frame.  And, according to the quantum theory, in the case of two entangled particles, a measure on one of the particles simultaneously affects the second one. Under which reference frame is this simultaneous? I was writing a toString() for a class in Java the other day by manually writing out each element of the class to a String and it occurred to me that using reflection it might be possible to create a generic toString() method that could work on ALL classes. I.E. it would figure out the field names and values and send them out to a String.  Getting the field names is fairly simple, here is what a co-worker came up with:  public static List initFieldArray(String className) throws ClassNotFoundException {      Class c = Class.forName(className);     Field field[] = c.getFields();     List&lt;String&gt; classFields = new ArrayList(field.length);      for (int i = 0; i &lt; field.length; i++) {         String cf = field[i].toString();         classFields.add(cf.substring(cf.lastIndexOf(".") + 1));     }      return classFields; }   Using a factory I could reduce the performance overhead by storing the fields once, the first time the toString() is called. However finding the values could be a lot more expensive.  Due to the performance of reflection this may be more hypothetical then practical. But I am interested in the idea of reflection and how I can use it to improve my everyday programming. Automatically redirect anonymous user from unanswered duplicate question to corresponding answered version Duplicate questions that use different words to describe the same problem are important for people to find the content via search engines. But the user experience when an anonymous user arrives at a duplicate is less than ideal.  They have to notice the duplicate link and understand that the answer they are looking for is likely behind that link. I don't think this is all that obvious to someone without experience with an SE site.  I propose to just redirect users to the duplicate automatically if the closed duplicate has zero answers. In that case they need to follow the link to the duplicate in any case, so we might as well redirect them to it in the first place.  I could imagine this being problematic with search engines, as we would be displaying different content than what the search engines see. If that is too problematic I would suggest to show a very obvious link to the duplicate in the answers section for anonymous users. How do I read / convert an InputStream into a String in Java? Meaning of different Orders of Derivative I have been trying to analyse the meaning of higher order derivatives and their geometrical significance.  Given a function $f(x)$ what are the unique geometric interpretation of its higher orders?   $f'(x)$ - slope (rate of change of x w.r.t y) $f''(x)$ - convexity / concavity of $f(x)$ based on $sign(f''(x))$ $f'''(x)$ - increasing / decreasing slope of $f'(x)$ $f''''(x)$ - ?? ... $f^n(x)$ - ??   I apologize if this question is rudimentary. Will grammar errors become correct after enough people use them for enough time? Opposite of "straight talk" What is the opposite for the straight talk idiom? How do I best call the activity when someone makes a very long preamble before he says what he wants? Microsoft recommends using Rowversion over timestamp, but I can not find "rowversion" data type inside my sql server 2008 R2 Microsoft  mentioned that we should use the rowversion data type over Timestamps. Now inside my SQL Server 2008 R2, I want to create a column with the Rowversion data type. But in my SQL Server 2008 R2 Management Studio, I cannot find such a data type:  Also when I tried altering existing column named timestamp which is of type timestamp using this statement: ALTER TABLE [SkillManagement].[dbo].[Customer] ALTER COLUMN timestamp rowversion   I get this error: Msg 4927, Level 16, State 1, Line 1 Cannot alter column 'timestamp' to be data type timestamp  Can anyone advise? EDIT Is the double dash still the posix standard for long switches? What are some alternatives to "hover" on touch-based devices? Came up recently in a 37signals podcast:    The straightforward, "brute-force" solution is to just use the first touch on a UI object as the hover.    It works. But are there other, more elegant solutions? For instance, could the hardware ever be made to support actual finger hovering? How can I make a hexagonal grill? Given a real positive sequence $\{a_n\}$ such that $\sum_{i=1}^n a_i$ converges.  Prove that there exists a real sequence $\{c_n\}$ monotonically increasing to $\infty$ such that $\sum_{i=1}^\infty a_nc_n$ converges.  What I have done:  I have written $$\sum_{i=1}^{N+1}a_ic_i=c_{N+1}\sum_{i=1}^{N+1}a_i-\sum_{i=1}^N(c_{n+1}-c_n)S_n$$  and then try to prove the convergence by the Cauchy criterion. However my evaluation is still not good enough. I'm really stuck. I'm trying to  working on Linux. I have PAINSTAKINGLY installed NVidia drivers, Cuda 5.0 and incidentally I'm failing on the last step when I run make:  make  all-recursive make[1]: Entering directory `/var/progs/CudaMiner' Making all in compat make[2]: Entering directory `/var/progs/CudaMiner/compat' Making all in jansson make[3]: Entering directory `/var/progs/CudaMiner/compat/jansson' gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..     -g -O2 -MT dump.o -MD -MP -MF .deps/dump.Tpo -c -o dump.o dump.c /bin/bash: gcc: command not found make[3]: *** [dump.o] Error 127 make[3]: Leaving directory `/var/progs/CudaMiner/compat/jansson' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/progs/CudaMiner/compat' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/progs/CudaMiner' make: *** [all] Error 2   I'm pretty sure I have gcc, in fact I have multiple versions of it. I installed version 4.6 (which is what cuda requires) but it doesn't seem to find it. I'm so close!  Thanks in advance. Prove that there are infinitely many primes and non-primes in the numbers $10^n+1$, where $n$ is a natural number. So numbers are 101, 1001, 10001 etc. First week of August in Scotland : What kind of clothes to pack? In a couple of weeks I will be going to Edinburgh, Scotland. I've been told that the weather is very unpredictable throughout the year. Can you suggest what I should pack as regards clothes?