Concatenate a string and number and compare that with another string in awk script
I have below code inside my awk script
Moderator's Comments:
Please use code tags
The issue here is it works fine when both in and out values are strings and gets an error when one of them is a number.
My input file has diff combinations, how can we convert it when we get a number in any one value?
Last edited by jim mcnamara; 08-27-2019 at 08:10 PM..
I want to concatenate any particular field of the file with any String say SSB....but i am not able to do it...
I hv tried the following code....but its saying there is error in parsing it..
awk 'BEGIN { FS = "," ; OFS = "," ; } { for ( i = 1 ; i < 5 ; i++ ) {a=i;b="SSB"; print $1,$a$b,$3 } }'... (3 Replies)
Hi,
I have a program written in awk and I want to extend it to do another task.
My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field)... (8 Replies)
I have the following simplified code that I am planning on putting into a larger shell script. I have been butchering it to try and make work amongst google searches and reading awk documentation.
amixer sset Master toggle | awk '{ if ( /^ Front Left/ { print $7 } == // ) print "MUTED" }'I... (2 Replies)
In Bash using AWK or sed I need to convert the following file:
...
numitem_tab0 =<p>1 KEYWORD</p><p>2 KEYWORD</p><p>3 KEYWORD</p><p>4 KEYWORD</p><p>5 KEYWORD</p>...<p>25 KEYWORD</p>
subitem_tab0 =<p></p><p></p>
...
numitem_tab6 =<p>1 KEYWORD</p><p>2 KEYWORD</p><p>3 KEYWORD</p><p>4 KEYWORD</p>... (2 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
I have a file that looks like this:
John Smith
http://www.profile1.com
http://www.profile2.com
http://www.profile3.com
Marc Olsen
http://www.profile4.com
http://www.profile5.com
http://www.profile6.com
http://www.profile7.com
Lynne Doe
http://www.profile8.com
http://www.profile9.com... (3 Replies)
Need help for awk..
file will have comma separated numbers, I need check digits before 10 numbers eg ( 001)1234567890
Basically want to check country code of a mobile number.
eg:
abc,def,data, data,0011234567890, data,data
Script should be checking country code with 001, I will pass... (10 Replies)
Hi all,
I was doing some string manipulation in my script and wanted to try using awk. However, I have been stuck with string compare. A simplified form of my conundrum is given below:
The below prints expected result (prints "Completed because that is the second element"):
$ echo... (5 Replies)
Hi All,
I have a file test.txt.
Content of test.txt :
1 vinay se
2 kumar sse
4 kishore tl
I am extracting the content of file with below command.
awk '$2 ~ "vinay" {print $0}' test.txt
Now instead of hardcoding $2 is there any way pass $2 as variable and compare with a... (7 Replies)
Hi,
I want to compare strings length to a number but i am getting error. I want first name should be length of 8.
Please help.
#bin !/bin/bash
clear
echo -n "Enter name "
read name
IFS=_
ary=($name)
for key in "${!ary}"; do echo "$key${ary}"; done
##First name should be equal to 8... (8 Replies)
Discussion started by: rajneesh4U
8 Replies
LEARN ABOUT FREEBSD
mailq
MAILQ(1) General Commands Manual MAILQ(1)NAME
mailq - print the mail queue
SYNOPSIS
mailq [-Ac] [-q...] [-v]
DESCRIPTION
Mailq prints a summary of the mail messages queued for future delivery.
The first line printed for each message shows the internal identifier used on this host for the message with a possible status character,
the size of the message in bytes, the date and time the message was accepted into the queue, and the envelope sender of the message. The
second line shows the error message that caused this message to be retained in the queue; it will not be present if the message is being
processed for the first time. The status characters are either * to indicate the job is being processed; X to indicate that the load is
too high to process the job; and - to indicate that the job is too young to process. The following lines show message recipients, one per
line.
Mailq is identical to ``sendmail -bp''.
The relevant options are as follows:
-Ac Show the mail submission queue specified in /etc/mail/submit.cf instead of the MTA queue specified in /etc/mail/sendmail.cf.
-qL Show the "lost" items in the mail queue instead of the normal queue items.
-qQ Show the quarantined items in the mail queue instead of the normal queue items.
-q[!]I substr
Limit processed jobs to those containing substr as a substring of the queue id or not when ! is specified.
-q[!]Q substr
Limit processed jobs to quarantined jobs containing substr as a substring of the quarantine reason or not when ! is specified.
-q[!]R substr
Limit processed jobs to those containing substr as a substring of one of the recipients or not when ! is specified.
-q[!]S substr
Limit processed jobs to those containing substr as a substring of the sender or not when ! is specified.
-v Print verbose information. This adds the priority of the message and a single character indicator (``+'' or blank) indicating
whether a warning message has been sent on the first line of the message. Additionally, extra lines may be intermixed with the
recipients indicating the ``controlling user'' information; this shows who will own any programs that are executed on behalf of this
message and the name of the alias this command expanded from, if any. Moreover, status messages for each recipient are printed if
available.
Several sendmail.cf options influence the behavior of the mailq utility: The number of items printed per queue group is restricted by
MaxQueueRunSize if that value is set. The status character * is not printed for some values of QueueSortOrder, e.g., filename, random,
modification, and none, unless a -q option is used to limit the processed jobs.
The mailq utility exits 0 on success, and >0 if an error occurs.
SEE ALSO sendmail(8)HISTORY
The mailq command appeared in 4.0BSD.
$Date: 2013-11-22 20:51:55 $ MAILQ(1)