awk modify string


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk modify string
# 8  
Old 01-14-2017
Removing non-alphabetic characters is easy with a gsub() call in awk. But knowing when the text before a space is to be thrown away and when it is to be included in the e-mail address is not something that Ravinder, I, or any other volunteer here can do for you unless you can explain the logic involved in making that decision.
This User Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Sed, awk or another bash command to modify string with the content of another file

Hello everybody, I would like modify some strings using sed or another command line with the content file. For example: - {fqdn: "server-01" , ip: "server-01"} - {fqdn: "server-02" , ip: "server-02"} - {fqdn: "server-03" , ip: "server-03"} - {fqdn: "server-04" , ip: "server-04"} My... (4 Replies)
Discussion started by: dco
4 Replies

2. Shell Programming and Scripting

Modify xml using sed or awk

Hi All, I want to modify(changing the status from "on" to "off" status of Stage-element value from the below xml file using sed or awk: File Name: global.xml <?xml version="1.0" encoding="UTF-8"?> <config> <widget> <name>HTTP-POOL</name> <attributes> ... (5 Replies)
Discussion started by: wamqemail2
5 Replies

3. Shell Programming and Scripting

Modify text file using awk

I have text file with lines as shown here. Each row has 11 columns separated by tab. In each row, i want to split the 8th column such that the output should look like shown below. Here value in the 9th column is DP value and in the 10th column is MQ value followed by the values after resource.EFF=.... (15 Replies)
Discussion started by: mehar
15 Replies

4. Shell Programming and Scripting

Modify awk statement

how do i modify the following: echo "jaba law welcome no jaba law sorry now jaba law" | awk '{s+=gsub(/jaba law/,"jaba law")} END {print s}' so that it shows me the actual phrase it found matching the strings i specified? something like: jaba law jaba law jaba law (4 Replies)
Discussion started by: SkySmart
4 Replies

5. Shell Programming and Scripting

modify awk

awk "BEGIN {if($PERCENT<$WARNING) {print \"OK\" ; exit 0} else if(($PERCENT>=$WARNING) && ($PERCENT<$CRITICAL)) {print \"WARNING\" ; exit 1} else if($PERCENT>=$CRITICAL) {print \"CRITICAL\" ; exit 2} }" how can i... (1 Reply)
Discussion started by: SkySmart
1 Replies

6. Shell Programming and Scripting

Modify an XLS file with Awk

Hello, I have 2 files. One has a list of serial numbers: 12345_7 2345_9 35454 4759:1 PEP8794 The other is an excel file, with multiple columns, separated by tab: 12345_7 ... ... .. .. .. .. .. 2345_9 ... ... .. .. .. .. .. 35454 ... ... .. .. .. .. .. 4759:1 ...... (4 Replies)
Discussion started by: ad23
4 Replies

7. Shell Programming and Scripting

awk can't modify the input file ??

Hi * I've just wanted to ask you if it's possible to modify the input file by using awk. Let me explain what I need: I need to change the value $4 from "defaults" to "nodev" in my text file. I've tried to use a string function called "sub" and it works. But I can't figure it out how to... (6 Replies)
Discussion started by: martinp111
6 Replies

8. Shell Programming and Scripting

modify and use awk sed program

The following awk script creates a file b.dat. awk '{print substr($0,1,27),substr($2,index($2,"_")+1)," ",substr($0,49)}' a.dat > b.dat I need this script to be modified to also sum $3 values by distinct $1 and $2 fields. Current file W2_2009275 2 8 W2_2009275 2 7 W1_2009275 1... (3 Replies)
Discussion started by: mnnarendra
3 Replies

9. Shell Programming and Scripting

Modify shell variables with AWK

Dear Folks, I have a command output something like: And I want to store PIN0 and SIG0 in two shell variables, now I do a double awk: PIN=`gsmctl -d /dev/ttyS0 pin sig | awk '/PIN0/ { print $2}'` SIG=`gsmctl -d /dev/ttyS0 pin sig | awk '/SIG0/ { print $2}'` It's possible to... (4 Replies)
Discussion started by: Santi
4 Replies

10. Shell Programming and Scripting

modify file using awk

I have a file, a.asc which is generated from a shell script: -----BEGIN PGP MESSAGE----- Version: PGP 6.5.8 qANQR1DBwE4DR5PN6zVjZTcQA/9z5Eg94cwYdTnC7v+JUegQuJwHripqnyjFrEs/ejzKYCNmngbHHmf8V4K3uFkYyp74aFf+CdymA030RKs6ewOwkmqRW19oIXCgVe8Qmfg+/2KTq8XN =0QSP -----END PGP MESSAGE----- I want... (12 Replies)
Discussion started by: nattynatty
12 Replies
Login or Register to Ask a Question
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)