Sponsored Content
Top Forums UNIX for Advanced & Expert Users awk - If then else rule like Excel cell Post 302905492 by myrole on Wednesday 11th of June 2014 11:39:58 PM
Old 06-12-2014
Linux awk - If then else rule like Excel cell

Hi,
I need extract / transpose where "Y" in the input file

My input file is
Code:
Item,EB,SB,SD,TP,GR
LP,Y,N,N,N,Y
GC,Y,N,N,N,N
CO,N,Y,Y,Y,Y
PS,Y,N,N,Y,Y

Expecting output is
Code:
EB-/'LP/',/'GC/',/'PS/'
SB-/'CO/'
SD-/'CO/'
TP-/'CO/',/'PS/'
GR-LP,CO,PS

I appreciate for your help

Regards
Balaji

Last edited by Scrutinizer; 06-12-2014 at 12:43 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change the cell background in excel sheet using Perl

I need to change a cell in an excel sheet to different background color using perl. Please help regarding this. Thanks and Regards, Neelam G (1 Reply)
Discussion started by: gujrathinr
1 Replies

2. Shell Programming and Scripting

How to change cell background in excel sheet using perl

I need to change a cell in an excel sheet to different background color using perl.I tried SaveParse, but was unable to get it Please help regarding this. Thanks and Regards, Neelam G https://www.unix.com/images/misc/progress.gif (0 Replies)
Discussion started by: gujrathinr
0 Replies

3. Shell Programming and Scripting

PERL: Modify Excel cell formatting

Hi, I would like to modify an existing excel cell format to a custom format. Is there a way to do it with out writing into a new excel file. In-place editing? Thanks (0 Replies)
Discussion started by: sandeep78
0 Replies

4. Shell Programming and Scripting

printing two lines in awk as two columns in excel

hi guys, i would like to print two lines from a file as two adjacent columns using excel using awk.. i have this so far: awk '{for(i=1; i<=NF; i++) {printf("%s\n",$i)}}' "$count".ttt > "$count".csv #this to print the first line from the .ttt file as rows of the first column in the .csv... (9 Replies)
Discussion started by: npatwardhan
9 Replies

5. Shell Programming and Scripting

Export into a single cell of excel sheet...

The awk is giving below output: SELECT divrel.child_org_idn org_main_idn NULL ( VARCHAR(200)) div_nam_2 NULL ( VARCHAR(200)) div_nam_3 NULL ( VARCHAR(200)) div_nam_4 NULL ( VARCHAR(200)) div_nam_5 NULL ( VARCHAR(200)) div_nam_6 NULL ( VARCHAR(200)) div_nam_7 ... (2 Replies)
Discussion started by: goutam_igate
2 Replies

6. Shell Programming and Scripting

Comparison of Cells in EXCEL using awk

Hi I have 2 csv files which looks like the following and i have to compare the 2 CSVs and create a third file such that if the value of the 1st cell in A.CSV and the value of the first cell in the B.CSV are same, it should print "SAME" in the third file or else print NOT SAME. Likewise i need... (19 Replies)
Discussion started by: meva
19 Replies

7. UNIX for Dummies Questions & Answers

AWK to excel

I've looked at a few different posts and none have entirely answered my question. Wondering how i'd go about using AWK to export to an excel file, which i gather would be a .csv file from what I've read. Atm my AWK command will read 2 files and export 2 files. Each of those files have 2... (3 Replies)
Discussion started by: Aussiemick
3 Replies

8. Shell Programming and Scripting

Perl - Append data to existing excel cell

Hello All, I have the following code in PERL to write data to excel sheet. Can someone please help me about how to append data to an exisitng cell? For ex in the below given case,Cell 1,1 has Active State PERL Now I want to add a new line like "prorgamming" without overwritting the... (3 Replies)
Discussion started by: prasperl
3 Replies

9. Shell Programming and Scripting

awk equivilent of Excel WEEKNUM()

I am trying to calculate the week (Sun-Sat) number for a given date with week 01 defined as the week that ends in the new year (the week with the first Saturday of the new year). Excel WEEKNUM() calls the week containing Jan 1 the first week. Using this, I can get what I want above by... (13 Replies)
Discussion started by: Michael Stora
13 Replies

10. Shell Programming and Scripting

Parse excel file with html on each cell

<DIV><P>Pré-condição aceder ao ecrã Home do MRS.</P></DIV><DIV><P>OK.</P></DIV><DIV><P>Seleccionar Pesquisa de Recepção Directa.</P></DIV><DIV><P>Confirmar que abriu ecrã de Recepção Directa.</P></DIV><DIV> (6 Replies)
Discussion started by: oliveiraum
6 Replies
Excel::Template::Element::Backref(3pm)			User Contributed Perl Documentation		    Excel::Template::Element::Backref(3pm)

NAME
Excel::Template::Element::Backref - Excel::Template::Element::Backref PURPOSE
Returns the cell location (i.e. B2) of the last cell to name this reference. To return the location of the entire range of cells to name this reference see RANGE. NODE NAME
BACKREF INHERITANCE
Excel::Template::Element ATTRIBUTES
o REF This is the name of the reference to look up. CHILDREN
None EFFECTS
None DEPENDENCIES
This will only be used within CELL tags. USAGE
In the example... <row> <cell ref="this_cell"/><cell ref="that_cell"><cell ref="that_cell"> </row> <row> <formula>=<backref ref="this_cell">+<backref ref="that_cell"></formula> </row> The formula in row 2 would be =A1+C1. C1 is the last to reference "that_cell". AUTHOR
Rob Kinyon (rkinyon@columbus.rr.com) SEE ALSO
CELL, RANGE perl v5.14.2 2012-04-29 Excel::Template::Element::Backref(3pm)
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy