how to retrieve lines that the first 4 columns have different values

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to retrieve lines that the first 4 columns have different values
# 15  
Old 07-23-2011
Thanks you alister!

---------- Post updated at 03:15 PM ---------- Previous update was at 03:13 PM ----------

Thank you, radoulov!
# 16  
Old 08-17-2011
Can you explain this code for me

awk '{for(i=n;iSmilieif($(a+i--)!=$a)break}i' a=2 n=3

I used the code, but it gave me different result from using the standard for loop one. Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print lines that have values in certain columns ?

Hi, everyone I have a dataset like this: A B C D A C C D E F G H F D K Y X A K K C Gsome of columns have no values in each line. I want to print all lines that have 1/2/3/4 values, export separately to four files. What I expected is like this: file1 Y file 2 A C X Afile 3... (3 Replies)
Discussion started by: nengcheng
3 Replies

2. Shell Programming and Scripting

Reading multiple values from multiple lines and columns and setting them to unique variables.

Hello, I would like to ask for help with csh script. An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
Discussion started by: FMMOLA
7 Replies

3. Shell Programming and Scripting

Compare columns of two files and retrieve data

Hi guys, I need your help. I have two files: file1 1 3 5 file2 1,XX 2,AA 3,BB 4,CC 5,DD I would like to compare the first column and where they are equal to write that output in a new file: 1,XX 3,BB (7 Replies)
Discussion started by: apenkov
7 Replies

4. Programming

Sctp api name to retrieve the values of structure sctpassoctable

Hi i want a sctp (lksctp) api which can retrieve the values of the sctp structure "sctpAssocTable" It is sctpassoctable or sctpassocentry. SctpAssocEntry ::= SEQUENCE { sctpAssocId Unsigned32, sctpAssocRemHostName OCTET STRING, sctpAssocLocalPort ... (1 Reply)
Discussion started by: harioum
1 Replies

5. Shell Programming and Scripting

Selecting lines having same values for first two columns

Hello to all. This is first post. Kindly excuse me if I do not adhere to any rules and regulations of this forum. I have a file containing some rows with three columns each per row(separeted by a space). There are certain rows for which first two columns have same value but the value in... (6 Replies)
Discussion started by: manojmalhotra13
6 Replies

6. Shell Programming and Scripting

Retrieve values using soap moudle

Can someone tell me how to know the values used in soap api. I need to know what values are used in soap xml. Can we get all the values used in soap api. I know that we can get it by using SOAP::Lite module in perl. But it is like we are supplying keys and we are getting values. I want... (0 Replies)
Discussion started by: Anjan1
0 Replies

7. Shell Programming and Scripting

Retrieve multiple values for each iteration

Hi All, I tried to retrieve multiple values using for/foreach loop in each iteration. But couldn't get it. Please help me. Below are my try outs: #!/bin/ksh foreach {i,j,k} {5150 5540 5149 5640 5151 5920 5362 5965 5147 5895 5061} echo $i,$j,$k end Error: ./mulcns.ksh: foreach: not... (4 Replies)
Discussion started by: cns1710
4 Replies

8. UNIX for Dummies Questions & Answers

How to compare two columns and retrieve data

I am a newbie to Unix and slowly learning it. I have a large data set with 8 different columns. I want to compare two columns and retrieve data if the two columns have similar number. I have attached the example. There are two columns (S-Contig and N-Contig). I want to retrieve the data from... (7 Replies)
Discussion started by: bjorngill
7 Replies

9. UNIX for Dummies Questions & Answers

need to retrieve values of parameter

Hi, I am just new to this shell scripting wizard..i have a text file which contains content as below: Parameter=10; What should be the script which only fetches the value 10 not the Parameter. The idea is to get the logic behind getting the value alone not its parameter,.... (6 Replies)
Discussion started by: d8011
6 Replies

10. Shell Programming and Scripting

to retrieve unique values

Hi all, I have a 10.txt file. In this file 2 words are present by name Active and Inactive and these words are repeated 7000 times. I want to take the unique 2 words from this 7000 lines. Thanks Mahalakshmi.A (3 Replies)
Discussion started by: mahalakshmi
3 Replies
Login or Register to Ask a Question