Sponsored Content
Top Forums Shell Programming and Scripting Add Column base on other Column Data Post 302959104 by RudiC on Wednesday 28th of October 2015 03:55:12 PM
Old 10-28-2015
This would really compare strings and not rely on field 3's structure:
Code:
awk '
!(REP)          {REP = $3
                 SKIP = 1
                }
                {TMP = $3
                 $3 = REP OFS $3
                }
!SKIP &&
TMP == REP      {REP = ""
                }
                {SKIP = 0
                }
1
' OFS="\t" file
M204    MS204_154    :vsDataUeMe    :vsDataUeMe
M204    MS204_154    :vsDataUeMe    es:sMeasure    0
M204    MS204_154    :vsDataUeMe    es:90ilterCoe    9
M204    MS204_154    :vsDataUeMe    es:searchE9090ortTime    40
M204    MS204_154    :vsDataUeMe    es:servOrPrioI90HoTimer    4000
M204    MS204_154    :vsDataUeMe    es:ueMeajllls154545    TRUE
M204    MS204_154    :vsDataUeMe    :vsDataUeMe
M204    MS204_154    :vsDataReport    :vsDataReport
M204    MS204_154    :vsDataReport    es:hysteresisA1Prim    10
M204    MS204_154    :vsDataReport    es:timeToTriggerA1Prim    640
M204    MS204_154    :vsDataReport    :vsDataReport
M204    MS204_154    :vsDataRep    :vsDataRep
M204    MS204_154    :vsDataRep    es:a1ThrdRrSc    -113
M204    MS204_154    :vsDataRep    es:tmoigeASec    640
M204    MS204_154    :vsDataRep    :vsDataRep

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace column that matches specific pattern, with column data from another file

Can anyone please help with this? I have 2 files as given below. If 2nd column of file1 has pattern foo1@a, find the matching 1st column in file2 & replace 2nd column of file1 with file2's value. file1 abc_1 foo1@a .... abc_1 soo2@a ... def_2 soo2@a .... def_2 foo1@a ........ (7 Replies)
Discussion started by: prashali
7 Replies

2. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

3. Shell Programming and Scripting

Change column to row base on column 2

Hi Guys, Input.txt L194 A -118.2 L194 B -115.1 L194 C -118.7 L196 A 0 L196 C 0 L197 A -111.2 L197 B -118.9 L197 C -119.9 L199 A -120.4 L199 B -119.9 ... (2 Replies)
Discussion started by: asavaliya
2 Replies

4. Shell Programming and Scripting

Copy same name data from other file base on column

HI I have input file A.txt X Y Z File B.txt 1 X 10 AAA 11123 2 Y 22 PlD 4563 3 Z 55 PlD 54645 4 Z 66 PlD 15698 5 F 44 PlD 154798 6 C 55 PlD 12554 7 Z 88 PlD 23265 8 C 99 PlD 151654 9 C 11 PlD 21546546 I need New File C.txt (1 Reply)
Discussion started by: pareshkp
1 Replies

5. Shell Programming and Scripting

Add column base on same name of second column

HI Guys, I have input file A.txt 1 AAA 1 BBB 1 1SW 1 2SW 1 3SW 1 BBB 1 PPP 1 1SW 1 PPP 1 1WS 1 1AS 1 P1P 1 AAA (1 Reply)
Discussion started by: pareshkp
1 Replies

6. Shell Programming and Scripting

Change Data base on Column

Base of last two column i want to change may data if Last two Column have A and C then Copy Column $4 to Column $3. Input :- DD142 0_1 DD142_A DD142_B A B DD142 1_1 DD142_B DD142_C B C DD142 2_1 DD142_A DD142_C A C DD142 3_1 DD142_A A DD142 3_2 DD142_A A DD142 4_1 DD142_B B ... (4 Replies)
Discussion started by: pareshkp
4 Replies

7. Shell Programming and Scripting

Grep Data Base on Column

HI Want to grep data from column header and match with second file. File A.txt 1 2 3 4 5 6 X1 A L D J Q R X2 B M K P w T X3 C S L P e Y X4 R Z M A r U FileB.txt 1 2 3 4 6 7 (3 Replies)
Discussion started by: pareshkp
3 Replies

8. Shell Programming and Scripting

Column to Row base on first and second Column

Input :- Column to Row Time CT 1 2 3 17:45 X 10 15 20 18:00 X 15 20 30 18:15 X 10 10 10 18:30 X 5 5 5 17:45 Y 10 15 20 18:00 Y 15 20 30 18:15 Y 10 10 10 18:30 Y 5 5 5 output:- Time P X Y 17:45 1 10 10 18:00 1 15 15 18:15 1 10 10 (2 Replies)
Discussion started by: pareshkp
2 Replies

9. UNIX for Beginners Questions & Answers

How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?

Source Code of the original script is down below please run the script and try to solve this problem this is my data and I want it column wise 2019-03-20 13:00:00:000 2019-03-20 15:00:00:000 1 Operating System LAB 0 1 1 1 1 1 1 1 1 1 0 1 (5 Replies)
Discussion started by: Shubham1182
5 Replies

10. UNIX for Beginners Questions & Answers

How to add a column of another data from another column?

Hola Como hacer: C:\System\SystemRun.4gl C:\System\SystemRunPrint.4gl C:\System\SystemViews.4gl Resultado: SystemRun.4gl C:\System\SystemRun.4gl SystemRunPrint.4gl C:\System\SystemRunPrint.4gl SystemViews.4gl C:\System\SystemViews.4gl... (0 Replies)
Discussion started by: tlaloc
0 Replies
shishi_ap_rep_verify_der(3)					      shishi					       shishi_ap_rep_verify_der(3)

NAME
shishi_ap_rep_verify_der - API function SYNOPSIS
#include <shishi.h> int shishi_ap_rep_verify_der(Shishi_ap * ap, char * der, size_t derlen); ARGUMENTS
Shishi_ap * ap structure that holds information about AP exchange char * der input array with DER encoded AP-REP. size_t derlen length of input array with DER encoded AP-REP. DESCRIPTION
DER decode AP-REP and set it in AP exchange using shishi_ap_rep_der_set() and verify it using shishi_ap_rep_verify(). RETURN VALUE
Returns SHISHI_OK, SHISHI_APREP_VERIFY_FAILED or an error. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_ap_rep_verify_der(3)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy