Sponsored Content
Top Forums UNIX for Advanced & Expert Users awk function in handling quotes Post 302445615 by shahnazurs on Monday 16th of August 2010 10:29:10 AM
Old 08-16-2010
awk function in handling quotes

Hi all,

I have input lines like below
Code:
empno,ename,sal,description
----------------------------

311,"jone,abc",2000,manager
301,david,200,"president,ac"

I need to sum the salary of them i.e. 2000+200

anything suggested

Thanks,
Shahnaz.

Moderator's Comments:
Mod Comment Use code tags.

Last edited by zaxxon; 08-16-2010 at 11:39 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

signal handling while in a function other than main

Hi, I have a main loop which calls a sub loop, which finally returns to the main loop itself. The main loop runs when a flag is set. Now, I have a signal handler for SIGINT, which resets the flag and thus stops the main loop. Suppose I send SIGINT while the program is in subloop, I get an error... (1 Reply)
Discussion started by: Theju
1 Replies

2. Shell Programming and Scripting

column handling in awk

Dear Scripting experts, I have a problem which i cannot get my head around and wondered if anyone can help me. I have two files "file1" and "file2" and i want to replace column one from file 1 with column one with file2.(where file two has many columns). see example.. ive tried to use cut and... (4 Replies)
Discussion started by: Mish_99
4 Replies

3. Programming

Handling a signal with a class member function

Hello, i am using the sigaction function to handle the SIGCHLD signal.Is it possible to use a class member function as the handler function (the sa_handler member of the sigaction structure)? The function's signature is: void (*sa_handler)(int);so i don't think i can use a static member function... (2 Replies)
Discussion started by: Zipi
2 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

quotes using awk

i want to print the statement below using awk,but i am unable to get the quotes ("22345",1,"Thank you"); How can i do this (5 Replies)
Discussion started by: tomjones
5 Replies

6. Shell Programming and Scripting

handling arrays with awk

Hi, I have an issue that I am trying to resolve using arrays in awk. I have two files, the first one is a dictionary with this format: FILE 1 (dictionary) 'Abrir' 'Open' 'Aceptar' 'Accept' Every line has two fields, a word in two languages. The second file is a simple list of... (3 Replies)
Discussion started by: gmartinez
3 Replies

7. Shell Programming and Scripting

awk without quotes

I want to execute awk command without quotes. who am i | awk {'print $2'} above code should be something like: who am i | awk {print $2} Why such weird requirement? Im assigning command to a variable, hence i need to escape the quotes. e.g: x='who am i | awk {\'print $2\'}' I want... (11 Replies)
Discussion started by: Arun_Linux
11 Replies

8. Shell Programming and Scripting

Handling embedded double quotes within column data

I have a text file where each field is enclosed in double quotes and separated by a comma. But in certain rows we have embedded double quotes within column data For e.g """TRUSPICE CENTRE"" CLAYTON AU" The above value is for a single column but there are embedded quotes within... (2 Replies)
Discussion started by: abhilashnair
2 Replies

9. Shell Programming and Scripting

Using quotes in awk

Hello, i had a problem running a script , and after investigation found its all to do with the quotes: cat file1 line1 val1 val2 line2 val1 val2 line3 val1 val2 awk 'BEGIN {RS="\n\n"; FS="\n";} {print $1 $2}' file1 This gives me the wrong output: (5 Replies)
Discussion started by: andy391791
5 Replies

10. Shell Programming and Scripting

Need help on awk for printing the function name inside each function

Hi, I am having script which contains many functions. Need to print each function name at the starting of the function. Like below, functionname() { echo "functionname" commands.... } I've tried like below, func=`grep "()" scriptname | cut -d "(" -f1` for i in $func do nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
FBSETROOT(1)							  Fluxbox Manual						      FBSETROOT(1)

NAME
fbsetroot - a simple background utility used by the fluxbox(1) window manager, originally written for and by the original blackbox(1) window manager. SYNOPSIS
fbsetroot [-display display] -solid color fbsetroot [-display display] -mod x y -fg color -bg color fbsetroot [-display display] -gradient texture -from color -to color fbsetroot -help DESCRIPTION
fbsetroot(1) is a utility that can control the appearance of the root window in three ways: Either give it a solid color, or write a two color modula pattern to it, or render a gradient texture, based on two different colors. fbsetroot resembles xsetroot(1) in this functionality but it supports multiple-screen displays, and gradient textures the same way as blackbox or fluxbox does. It doesn't handle cursors etc. fbsetroot was originally part of the Blackbox package and was carried over with the code that became Fluxbox. It was called bsetroot back in those days. If any errors are encountered, fbsetroot will use either gxmessage(1) or xmessage(1) to inform the user of errors. OPTIONS
fbsetroot operates in three ways, you must choose one of the first 3 options: -solid color Sets the root window to specified color. -mod x y Creates a modula pattern. You must specify -bg and -fg colors. -gradient texturestring Renders the specified texture string to the root window. texturestring may be one of: Horizontal / Vertical / Diagonal / Crossdiagonal / Pipecross / Elliptic / Rectangle / Pyramid Select one of these texture types, they only apply when -gradient is specified. You must also specify both a -from and a -to color. -display display Tells fbsetroot to connect to the specified display. -bg, -background color Background color. Needed for -mod patterns. -fg, -foreground color Foreground color. Needed for -mod patterns. -from color Start color for rendering textures. Needed for -gradient patterns. -to color Ending color for rendering textures. Needed for -gradient patterns. -help Prints version info and short help text. AUTHORS
This manpage was modified by Curt "Asenchi" Micol <asenchi at asenchi.com> for the Fluxbox window manager. Further updates for fluxbox-1.1.2 and conversion to asciidoc format by Jim Ramsay <i.am at jimramsay.com> SEE ALSO
fluxbox(1) fbsetbg(1) xsetroot(1) xmessage(1) gxmessage(1) AUTHOR
Jim Ramsay <i.am@jimramsay.com> Author. fbsetroot.txt 28 October 2011 FBSETROOT(1)
All times are GMT -4. The time now is 08:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy