Sponsored Content
Top Forums Shell Programming and Scripting awk to extract multiple values from file and add two additional fields Post 302983351 by RavinderSingh13 on Monday 10th of October 2016 01:49:37 PM
Old 10-10-2016
Hello cmccabe,

Could you please be more clear into your requirements, not clear like whichever conditions you need to get your expected output. Good that you are showing your attempts to us, would like to request you to let us know all conditions/requirements that you need to get your expected output.

Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

2. UNIX for Dummies Questions & Answers

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

3. Shell Programming and Scripting

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (3 Replies)
Discussion started by: yerruhari
3 Replies

4. Shell Programming and Scripting

Handling multiple fields of a database file for toupper() function in awk

hello everyone.... script is: To convert the contents of a database file into uppercase my code is: printf "%s\n" , $2 | awk '{print toupper($2)}' emp.lst i m able to do only for one field.....didn't get any sources for handling multiple fields. please suggest me for multiple... (1 Reply)
Discussion started by: Priyanka Bhati
1 Replies

5. Shell Programming and Scripting

Inserting additional comma delimiters in a csv file, after and before certian fields.

Hello I have a csv file which I need to insert addtional commas into. The csv is of the format field1,field2,field3,field4,...etc...,field13,field14 I need to add extra commas in each record so that the final output looks like ... (1 Reply)
Discussion started by: kamal_p_99
1 Replies

6. Shell Programming and Scripting

Merge values from multiple directories into one file in awk or bash

I am trying to merge or combine all $1 values in validation.txt from multiple directories into one new file and output it here tab-delimited:/home/cmccabe/Desktop/20x/total/total.txt. Each $2 value and the header would then be a new field in total.txt. I am not sure how to go about this as cat is... (2 Replies)
Discussion started by: cmccabe
2 Replies

7. Shell Programming and Scripting

awk to print line is values between two fields in separate file

I am trying to use awk to find all the $3 values in file2 that are between $2 and $3 in file1. If a value in $3 of file2 is between the file1 fields then it is printed along with the $6 value in file1. Both file1 and file2 are tab-delimited as well as the desired output. If there is nothing to... (4 Replies)
Discussion started by: cmccabe
4 Replies

8. Shell Programming and Scripting

Extract multiple values into corresponding variables

Here is my input # MANIFEST.MF Manifest-Version: 1.0 Build-Jdk: 1.6.0 Built-By: CM_TEAM Build_SvnRev: 662789 Build_Number: 13.0.0.0-JDK8 Build_Date: Wed 04/05/2017-20:48:19.17 Archiver-Version: Plexus Archiver Created-By: Apache Maven 3.1.0 Here is the expected output:... (4 Replies)
Discussion started by: kchinnam
4 Replies

9. Shell Programming and Scripting

awk to print lines based on text in field and value in two additional fields

In the awk below I am trying to print the entire line, along with the header row, if $2 is SNV or MNV or INDEL. If that condition is met or is true, and $3 is less than or equal to 0.05, then in $7 the sub pattern :GMAF= is found and the value after the = sign is checked. If that value is less than... (0 Replies)
Discussion started by: cmccabe
0 Replies

10. Shell Programming and Scripting

Help with awk to extract additional info

Hi I use multipath linux command to get LUNs info and find out if any failed. # multipath -ll >/tmp/mpfail # cat /tmp/mpfail multipath.conf line 109, invalid keyword: user_friendly_names multipath.conf line 153, invalid keyword: user_friendly_names multipath.conf line 193, invalid... (4 Replies)
Discussion started by: prvnrk
4 Replies
clear(3NCURSES) 														   clear(3NCURSES)

NAME
erase, werase, clear, wclear, clrtobot, wclrtobot, clrtoeol, wclrtoeol - clear all or part of a curses window SYNOPSIS
# include <curses.h> int erase(void); int werase(WINDOW *win); int clear(void); int wclear(WINDOW *win); int clrtobot(void); int wclrtobot(WINDOW *win); int clrtoeol(void); int wclrtoeol(WINDOW *win); DESCRIPTION
The erase and werase routines copy blanks to every position in the window, clearing the screen. The clear and wclear routines are like erase and werase, but they also call clearok, so that the screen is cleared completely on the next call to wrefresh for that window and repainted from scratch. The clrtobot and wclrtobot routines erase from the cursor to the end of screen. That is, they erase all lines below the cursor in the win- dow. Also, the current line to the right of the cursor, inclusive, is erased. The clrtoeol and wclrtoeol routines erase the current line to the right of the cursor, inclusive, to the end of the current line. Blanks created by erasure have the current background rendition (as set by wbkgdset) merged into them. RETURN VALUE
All routines return the integer OK on success and ERR on failure. The SVr4.0 manual says "or a non-negative integer if immedok is set", but this appears to be an error. X/Open defines no error conditions. In this implementation, functions using a window pointer parameter return an error if it is null. NOTES
Note that erase, werase, clear, wclear, clrtobot, and clrtoeol may be macros. PORTABILITY
These functions are described in the XSI Curses standard, Issue 4. The standard specifies that they return ERR on failure, but specifies no error conditions. Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of clearok(..., 1) by saying touch- win(stdscr) or clear(stdscr). This will not work under ncurses. This implementation, and others such as Solaris, sets the current position to 0,0 after erasing via werase() and wclear(). That fact is not documented in other implementations, and may not be true of implementations which were not derived from SVr4 source. Not obvious from the description, most implementations clear the screen after wclear even for a subwindow or derived window. If you do not want to clear the screen during the next wrefresh, use werase instead. SEE ALSO
ncurses(3NCURSES), outopts(3NCURSES), refresh(3NCURSES) clear(3NCURSES)
All times are GMT -4. The time now is 03:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy