Sponsored Content
Top Forums Shell Programming and Scripting Add Column base on other Column Data Post 302959101 by pareshkp on Wednesday 28th of October 2015 03:39:29 PM
Old 10-28-2015
Thanks .....its working ...

if any row have 4th column blank then it giving me wrong output.

Input :-

Code:
M204	MS204_154	:vsDataUeMe	
M204	MS204_154	es:sMeasure	0
M204	MS204_154	es:90ilterCoe	9
M204	MS204_154	es:searchE9090ortTime	40
M204	MS204_154	es:servOrPrioI90HoTimer	4000
M204	MS204_154	es:ueMeajllls154545	TRUE
M204	MS204_154	:vsDataUeMe	
M204	MS204_154	:vsDataReport	
M204	MS204_154	es:hysteresisA1Prim	
M204	MS204_154	es:timeToTriggerA1Prim	
M204	MS204_154	:vsDataReport	
M204	MS204_154	:vsDataRep	
M204	MS204_154	es:a1ThrdRrSc	-113
M204	MS204_154	es:tmoigeASec	640
M204	MS204_154	:vsDataRep

Code:
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	hysteresisA1Prim	es:hysteresisA1Prim	
M204	MS204_154	hysteresisA1Prim	es:timeToTriggerA1Prim	
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

That's Wrong .. I want only that data which have "vsData" String
 

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
CUBRID_COLUMN_NAMES(3)							 1						    CUBRID_COLUMN_NAMES(3)

cubrid_column_names - Get the column names in result

SYNOPSIS
array cubrid_column_names (resource $req_identifier) DESCRIPTION
The cubrid_column_names(3) function is used to get the column names of the query result by using $req_identifier. PARAMETERS
o $req_identifier -Request identifier. RETURN VALUES
Array of string values containing the column names, when process is successful. FALSE, when process is unsuccessful. EXAMPLES
Example #1 cubrid_column_names(3) example <?php $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); $result = cubrid_execute($conn, "SELECT * FROM game WHERE host_year=2004 AND nation_code='AUS' AND medal='G'"); $column_names = cubrid_column_names($result); $column_types = cubrid_column_types($result); printf("%-30s %-30s %-15s ", "Column Names", "Column Types", "Column Maxlen"); for($i = 0, $size = count($column_names); $i < $size; $i++) { $column_len = cubrid_field_len($result, $i); printf("%-30s %-30s %-15s ", $column_names[$i], $column_types[$i], $column_len); } cubrid_disconnect($conn); ?> The above example will output: Column Names Column Types Column Maxlen host_year integer 11 event_code integer 11 athlete_code integer 11 stadium_code integer 11 nation_code char 3 medal char 1 game_date date 10 SEE ALSO
cubrid_prepare(3), cubrid_execute(3), cubrid_column_types(3). PHP Documentation Group CUBRID_COLUMN_NAMES(3)
All times are GMT -4. The time now is 02:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy