Hello Don,
My bad ....you are right that 123,125,126 are missing. So, I am thinking if these values come out of the input file by any script or so.
Thanks a lot
---------- Post updated at 11:52 PM ---------- Previous update was at 11:50 PM ----------
Hi Don,
$2 is not important , I am just thinking if I get an output which looks like 123,125,126.
Thanks
Following may help you in same.
Output will be as follows. EDIT: Above solution will work when all 1st columns are sorted so if 1st column is not sorted then you can do following too for same.
Output will be as follows.
Thanks,
R. Singh
Last edited by RavinderSingh13; 07-23-2015 at 02:35 AM..
Reason: Added one more solution for same
This User Gave Thanks to RavinderSingh13 For This Post:
If unsorted input is possible, you could also try something like:
which, using RavinderSingh13's test57 sample input file, produces the output:
just using awk without needing to invoke sort.
Note that if the number of digits in the values in the first field is not constant and you use the code Ravinder and Akshay suggested for unsorted input, you should change the sort command from:
or:
, respectively, to:
or:
, respectively, to force a numeric sort rather than an alphanumeric sort.
Hello!
I'm making an English to Morse Code translator and I was able to mostly get it all working by looking through older posts here; however, I have one small problem.
When I run it it's just printing spaces for where the characters should be. It runs the right amount of times, and if I try... (3 Replies)
Hi All
I had requirement where I need to re-order columns in a file by using a control file.
here is the ctrl file
c1
c2
c3
source file
c3 | c1 | c2
a | b| c
I should create output file based on the ctrl file columns
o/p should look like this
c1 | c2 | c3
b| c|a
I wrote some... (9 Replies)
I have a class
and want to print values in MOD using
L = new Layer* ;
How can I print the values in MOD using this object L???
class Layer
{
public :
Model* MODP;
Model* MODS; (1 Reply)
Hi,
I have a tab delimited text file with three columns:
Input:
1 25734 25737
1 32719 32724
1 59339 59342
1 59512 59513
1 621740 621745
For each row of the text file I want to print out all the values between the second and third columns, including them. The... (3 Replies)
Hi,
I have small problem to print float value in the fallowing code
float Cx, W,f=250000, Cr=92.00,pi=3.14;
W=2*pi*f;
Cx = 1/W.Cr; //Cx value will be come around like 7.07E-9.
printf("capacitance value: %.10f",Cx);
I am trying to print Cx value using above code but it was not... (3 Replies)
i need to do camparisions like the below.
For the case when first=10 and second=9.9 the scripts displays process failed.
I need to be able to convert the values to integer before doing the comparision.
Like 9.9 should be rounded over to 10 before doing comparision.
Please advice how can... (3 Replies)
Dear friends,
I want to print variables' values in certain format where space between two values of variables is "a tab"
I tried where I provided "tab" between two varibales.
But when it print values on screen its giving me output without spaces in two values.
Request you to help me in... (7 Replies)
I have written a phyton script that accepts command line arguments. I am setting defaults for some of them if the user does not specify them. However I want to print the user values and the defaulted values seperately. However, once I set the default values, then I cannot use
if... (0 Replies)
How can I compare two integer values which is stored in char pointers?
suppose I have char *a and char *b having values 10 and 20. how can i find the shorter value? (1 Reply)
I am trying to create a script that will read from a file two non-integer values (decimals) and add those values together. For example, I want to add 1.51 and -2.37 together and get the sum. Any ideas? Thanks! (2 Replies)