I have a scenario where I want to get column position number   ID|NAME|S1|BQ|S2|VN|D1 1|vimal|10.12|12.4|56.2|12.2|11.22 2|vilas|10.12|12.4|56.2|12.2|11.22 3|viky|10.12|12.4|56.2|12.2|11.22  column name : S1|S2|D1   Output should be below:   3 5 7   I tried below code but partially provide output   awk -F"|" 'NR==1{for(i=1;i&lt;=NF;i++){print $i"=$"i}}' demo.txt | grep -E "S1|S2|D1"  S1=$3 S2=$5 D1=$7   Need output like below  3 5 7
i have a scenario where i want to know in which position number the column name comes   like i have sample data below   ID|NAME|S1|BQ|S2|VN|D1 1|vimal|10.12|12.4|56.2|12.2|11.22 2|vilas|10.12|12.4|56.2|12.2|11.22 3|viky|10.12|12.4|56.2|12.2|11.22   Colum name : S1 S2 D1   output should be :  3 5 7
Calling future method from batch class? I want to do something like:  MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone();   And then make changes to the new object that are not reflected in the original object.  I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation.  How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object? Output the common lines (similarities) of two text files (the opposite of diff)? Diff is a great tool to display the changes between two files. But how to display the similarities of two text files (while ignoring the differences)?  I.e. sample input:  a: Foo Bar X Hello World 42  b: Foo Baz Hello World 23   Pseudo output (something like this):  @@ 2,3 =Hello World   Just sorting both files and using comm is not enough, because in that case the line information is lost. How to identify predatory publishers/journals What are the best strategies for assessing if a journal is a &quot;vanity&quot; or &quot;predatory&quot; journal that should be avoided (both for publishing in and reviewing for)? For example, how would one go about determining if a journal/publisher belongs on ? Is it because Rey just saved BB-8 from a net, and then the droid just decides to follow her about - or is it for some other reason?  Does BB-8 have any idea who Rey is prior to being rescued by her?  Just wondering as she literally tells the droid to go elsewhere. How to combine two jQuery results How do you combine two jQuery search results? eg:  var $allFoos = $('.foo'),     $allBars = $('.bar')     $allFoosAndBars = $allFoos + $allBars;   Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, and it could be any arbitrary sets i'm talking about, so $('.foo, .bar') is not what I'm after. Most efficient way to randomly "sort" (Shuffle) a list of integers in C# I need to randomly 'sort' a list of integers (0-1999) in the most efficient way possible.  Any ideas?  Currently, I am doing something like this:  bool[] bIndexSet = new bool[iItemCount];  for (int iCurIndex = 0; iCurIndex &lt; iItemCount; iCurIndex++) {     int iSwapIndex = random.Next(iItemCount);     if (!bIndexSet[iSwapIndex] &amp;&amp; iSwapIndex != iCurIndex)     {         int iTemp = values[iSwapIndex];         values[iSwapIndex] = values[iCurIndex];         values[iCurIndex] = values[iSwapIndex];         bIndexSet[iCurIndex] = true;         bIndexSet[iSwapIndex] = true;     } } Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.) Is there a way (eg. a binary hack into Finder) to stop it from creating .DS-Stores on LOCAL Volumes?   I am using Leopard, therefore these don't work:    (requires Lion)  (requires Snow Leopard)   Also,  slows down my computer. How do I get a mesh data-block with modifiers and shape keys applied in Blender 2.8? I'm trying to update an exporter to work with Blender 2.8 but can't seem to get a mesh data-block modified by modifiers or shape keys. It always gives me the base mesh.  I'm currently using Object.to_mesh(). But reading Object.data or bmesh.from_mesh(obj) all returns only the base mesh. So what is the new function to call for getting a mesh data-block with the modifiers and shape keys applied? Git for beginners: The definitive practical guide I can't add a book that I've written that's not on Amazon Is there any chance that there will be support to my Careers profile for adding books that aren't available to purchase through Amazon.com? My book was published through Smashing Magazine and it isn't available there. I compile my project with VIsual Studio 2005 Express Edition, and get this linking error. Can anyone suggest how to solve that? When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time before any results are returned.  Also, this is usually successful in highlighting the worst offender but I've often found myself resorting to du without the sort in more subtle cases and then had to trawl through the output.  I'd prefer a command line solution which relies on standard Linux commands since I have to administer quite a few systems and installing new software is a hassle (especially when out of disk space!) Why did the Tethered form a line in Us? In Jordan Peele's  we see that the Tethered plan a revolt, rise above ground and start murdering everyone in sight and then they form a line by holding hand in hand.   What was the purpose of that? Is there any direct relation among first, third, fourth order moments? Problem in solving functional equation $f(x^2 + yf(x)) = xf(x+y)$ To find all functions $f$ which is a real function from $\Bbb R \to \Bbb R$ satisfying the relation  $$f(x^2 + yf(x)) = xf(x+y)$$  It can be easily seen that the identity function $i.e.$ $f(x)=x$ and $f(x)=0$ (verified just now) satisfies the above relation!! And putting $y=0$ I have got $f(x^2)=xf(x)$.  Help needed to find other functions satisfying the relation. How to use enum values in f:selectItem(s) Cardinality of set of real continuous functions I believe that the set of all $\mathbb{R\to R}$ continuous functions is $\mathfrak c$, the . However, I read in the book &quot;Metric spaces&quot; by Ó Searcóid that set of all $[0, 1]\to\mathbb{R}$ continuous functions is greater than $\mathfrak c$:  &quot;It is demonstrated in many textbooks that $\mathbb{Q}$ is countable, that $\mathbb{R}$ is uncountable, that every non-degenerate interval is uncountable, that the collection of continuous functions deﬁned on  $[0,1]$ is of a greater cardinality than $\mathbb{R}$, and that there are sets of greater and greater cardinality.&quot;  I understand that (via composition with the continuous function $\tan$ or $\arctan$) these sets of continuous functions have the same cardinality. Therefore, which claim is correct, and how do I prove this? Is trace invariant under cyclic permutation with rectangular matrices? I'm working with trace of matrices. Trace is defined for square matrix and there are some useful rule, i.e. $\text{tr}(AB) = \text{tr}(BA)$, with $A$ and $B$ square, and more in general trace is invariant under cyclic permutation. I was wondering if the formula $\text{tr}(AB) = \text{tr}(BA)$ holds even if $A$ and $B$ are rectangular, namely $A$ is $n$-by-$m$ and $B$ is $m$-by-$n$. I figured out that if one completes the involved matrices to be square by adding zero entries in the right places, then the formula still works... but I want to be sure about this!