OK OK!!!! I agree its not home work question
but i didn't understand how 072 is triplet in 01072523??
you mean 0-7>3 and 7-2>3 {first-sec or sec-first>3}???
if so below code will work.. I know it can be done much smaller way..but for better understanding it wrote like this
This appears to work well. Thank you Tutor! I will pick this apart and no doubt learn some more awk from it.
You're right- 072 should be a matching triplet. I missed it! What I was going to write was "plus or minus greater than or equal to 3" or denote it as "+- >=". Perhaps I could have said "a pos or neg integer that is 3, 4, 5, 6, 7, 8, or 9".
Anyway, I think you understood what I meant.
Also thanks Scrutinzer. My default is actually pdksh v5.2.14 so your ksh script is good to have. I need to not only learn more awk but also more ksh.
I rarely use bash; I use zsh sometimes, e.g. if I need brace expansion.
Hi All ,
I am having an input file as stated below
5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011
611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011
3486... (4 Replies)
Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows:
2012-01-18 string of words here 123.jpg
2012-01-18 string of words here 1234.jpg
2012-01-18... (2 Replies)
HI,
i am new to perl world.
And i am trying to compress a file, as given below procedure.
INPUT FILE:
1 1 2 1 ==> R1
2 1 3 1 ==> R2
3 1 4 1 ==> R3
OUTPUT FILE:
1 1 4 1 (3 Replies)
Hi friends,
I have a xlsheet like below first column having id ABCfollowed by 7digit numbers and the next column have title against the ids. Titles are unique and duplicateboth, but ids are unique even for duplicate title.Now I need to identify those duplicate title having the highest id for... (9 Replies)
Hi all,
I have a text file consisting of 4 columns. What I am trying to do is see whether column 2 repeats multiple times, and collapse those repeats into one row. For example, here is a snippet of the file I am trying to analyze:
1 Gamble_Win 14.282 0.502
1 Sure_Thing 14.858 0.174
1... (4 Replies)
Dear All,
I need to find the difference between two adjacent columns. The file is having 'i' columns and i need to find the difference between two adjacent columns (like $1 difference $2; $2 difference $3; .... and $(i-1) difference $i). I have used the following coding
awk '{ for (i=1; i<NF;... (7 Replies)
Hi Folks
Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names:
m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done
m@pyhead:~$ ls file*... (2 Replies)
how do you print the lines before and after the line you are interested in? Example: Line to be printed: line 344
Output:
line 343
line 344
line 345
Thanks (1 Reply)