Sponsored Content
Top Forums Shell Programming and Scripting Comparison of Cells in EXCEL using awk Post 302399805 by alister on Monday 1st of March 2010 04:03:20 PM
Old 03-01-2010
I know it's a couple of weeks old and that the original problem has been solved, but the revival of this thread brought it to my attention and i thought i'd toss one in anyway Smilie
Code:
$ paste -d, a b | awk -F, '{for(i=1;i<=NF/2;i++) printf("%sSAME,",$i!=$(i+NF/2)?"NOT ":""); print ""}'
SAME,SAME,SAME,NOT SAME,
SAME,SAME,SAME,SAME,
SAME,SAME,SAME,SAME,
SAME,SAME,SAME,SAME,

Cheers,
Alister

Last edited by alister; 03-01-2010 at 05:10 PM.. Reason: i changed data during testing and it was reflected in the output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX -> send data as excel in seperate cells

Hi I have a data file in UNIX as follows. I need to send this file in Mail as excel format. but the problem i face is i get the data all in single cells per row. what can i do to get the data in seperate cells. File -> attachment.xls data data data data data1 data1 ... (1 Reply)
Discussion started by: vj8436
1 Replies

2. UNIX for Dummies Questions & Answers

multiple comparison in awk

I have an input file. Each line in it has several characters. If the first three characters of the line is '000' or '001' or '002' or '003', I need to print it in output. How can I do this in awk. I am able to do if the search string is only one (let us say 000). cat <filename> | awk... (1 Reply)
Discussion started by: paruthiveeran
1 Replies

3. Programming

grouping and ungrouping of excel cells using java

Dear Folks, Is there anyone know how to do the group and ungroup cells feature of MS Excel through java. Please help. Please find the attachment.I want the code to do something like this. (0 Replies)
Discussion started by: dinesh1985
0 Replies

4. Shell Programming and Scripting

Comparison and editing of files using awk.(And also a possible bug in awk for loop?)

I have two files which I would like to compare and then manipulate in a way. File1: pictures.txt 1.1 1.3 dance.txt 1.2 1.4 treehouse.txt 1.3 1.5 File2: pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244 dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies

5. Shell Programming and Scripting

awk comparison

Hello all, Probably a very simple question, I am stuck with a small part of a code: I am trying to do a comparison to get the maximum value of column 6 if columns 1, 4 and 5 of two or more rows match. Here is what I am doing: awk -F'\t' '{if ($6 > a)a=$6}END{for (i in a) print i"\t"a}' ... (4 Replies)
Discussion started by: jaysean
4 Replies

6. Shell Programming and Scripting

Merge two cells in excel via UNIX?

Hi UNIX Gods! Is it possible to merge two cells in .csv file using unix commands? Imagine that this is my present csv file opened via excel: Gate Reports| | fatal alerts | 200 | is is possible to make it look like this using unix? Gate Reports | fatal... (1 Reply)
Discussion started by: 4dirk1
1 Replies

7. Shell Programming and Scripting

Need help with simple comparison in AWK

Hi, I'm new to AWK and I'm having problems comparing a field to a string variable. /ARTIST/ {x = $2} $1 ~ x {print $0}My code tries to find a record with the string "ARTIST". Once it finds it, it stores the second field of the record into a variable. I don't know what the problem is for the... (7 Replies)
Discussion started by: klusps
7 Replies

8. Shell Programming and Scripting

awk comparison with two patterns

Here is my list, which contains URLs for file downloads: //servername.com/version/panasonic1,1_1.1.1 //servername.com/version/panasonic3,1_6.7.1 //servername.com/version/panasonic3,2_6.8 //servername.com/version/panasonic2,6_3.0.2 //servername.com/version/panasonic3,1_7.1.3... (5 Replies)
Discussion started by: ibanezpete
5 Replies

9. Programming

Perl script to merge cells in column1 which has same strings, for all sheets in a excel workbook

Perl script to merge cells ---------- Post updated at 12:59 AM ---------- Previous update was at 12:54 AM ---------- I am using below code to read files from a dir and print to excel. open(my $in, '<', $file) or die "Could not open file: $!"; my $rowCount = 0; my $colCount = 0;... (11 Replies)
Discussion started by: Jack_Bruce
11 Replies

10. UNIX for Beginners Questions & Answers

awk replace cells with NaN/delete if condition

Hello, I will like to delete/replace $3 with NaN. condition $3>-2000 (file1.dat) to produce out.dat. I want to retain the structure of the table. I use this code, this output only $3. Any idea on how to modify this code. Thank you. awk -v OFS='' '{for(i=1; i<=NF; i++) if ($i > -2000 || $i ==" >... (4 Replies)
Discussion started by: geomarine
4 Replies
cdsalias(1m)															      cdsalias(1m)

NAME
cdsalias - A dcecp object that lets you manipulate cell names in CDS SYNOPSIS
cdsalias catalog cdsalias connect cdsalias create cellalias_name cdsalias delete cellalias_name cdsalias help [operation | -verbose] cdsalias operations ARGUMENTS
A single, fully qualified alias name of the cell in the following form: /.../cellalias_name The name of the cdsalias operation for which to display help information. DESCRIPTION
The cdsalias object represents cell names as known by the Cell Directory Service (CDS). This object lets you manipulate alias and pre- ferred names of DCE cells. Each cell has one preferred name. Cells may also have alias names. This object affects only the CDS compo- nent. The security server and each host must also be informed of any new cell aliases. This object can also be used to define a hierarchical relation between one cell and another by connecting the first cell's root directory namespace into the the second cell's namespace. When defining a hierarchical relationship, you must use the account command to establish a trust relationship between the cells. To manipulate alias and preferred names, the CDS_DirectoryVersion attribute must be set to 4.0 or greater. See the ATTRIBUTES section of the directory command for more information. OPERATIONS
cdsalias catalog Returns a list of all defined cell aliases in CDS. The syntax is as follows: cdsalias catalog The catalog operation returns a list of all defined cell aliases in CDS. Each alias name is labeled either alias or primary, depending on which name is the current preferred name. Privileges Required Requires r (read) permission on the root directory of the cell. Examples dcecp> cdsalias catalog {CDS_CellAliases {Alias /.../green.cell.osf.org} {Primary /.../blue.cell.osf.org}} dcecp> cdsalias connect Establishes a hierarchical relationship between two cells. The syntax is as follows: cdsalias connect The connect operation creates a hierarchical relationship between two cells. It takes no argument. The current preferred name of the cell is used and the last relative distinguished name (RDN) is removed to identify the parent cell. This operation returns an empty string on success. Privileges Required Requires a (auth_info) permission on the the local cell's root directory. Also, the CDS server principal on the machine containing the master replica of the local cell's root directory needs i (insert) permission on the parent cell's root directory. Examples dcecp> cdsalias connect dcecp> cdsalias create Creates a new alias cell name in CDS. The syntax is as follows: cdsalias create cellalias_name The create operation creates a new alias cell name in CDS. The required argument is a single fully qualified alias name of the cell. This operation returns an empty string on success. Privileges Required Requires a (auth_info) permission on the root directory of the cell. Examples dcecp> cdsalias create /.../green.cell.osf.org dcecp> cdsalias delete Deletes an existing alias cell name from CDS. The syntax is as follows: cdsalias delete cellalias_name The delete operation deletes an existing alias cell name from CDS. The required argument is a single fully qualified alias name of the cell. If the alias name does not exist, an error is returned. You cannot use this command to delete the preferred cell name. This opera- tion returns an empty string on success. Privileges Required Requires a (auth_info) permission on the root directory of the cell. Examples dcecp> cdsalias delete /.../green.cell.osf.org dcecp> cdsalias help Returns help information about the cdsalias object and its operations. The syntax is as follows: cdsalias help [operation | -verbose] Options Displays information about the cdsalias object. Used without an argument or option, the cdsalias help command returns brief information about each cdsalias operation. The optional opera- tion argument is the name of an operation about which you want detailed information. Alternatively, you can use the -verbose option for more detailed information about the cdsalias object itself. Privileges Required No special privileges are needed to use the cdsalias help command. Examples dcecp> cdsalias help catalog Returns the aliases known by CDS for the named cell. connect Establishes a hierarchi- cal relationship between two cells. create Creates the named cdsalias for the local cell. delete Deletes the existing cdsalias from the local cell. help Prints a summary of command-line options. operations Returns a list of the valid operations for this command. dcecp> cdsalias operations Returns a list of the operations supported by the cdsalias object. The syntax is as follows: cdsalias operations The list of available operations is in alphabetical order except for help and operations, which are listed last. Privileges Required No special privileges are needed to use the cdsalias operations command. Examples dcecp> cdsalias operations catalog connect create delete help operations dcecp> RELATED INFORMATION
Commands: dcecp(1m), dcecp_account(1m), dcecp_cellalias(1m), dcecp_directory(1m), dcecp_hostdata(1m). cdsalias(1m)
All times are GMT -4. The time now is 10:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy