Sponsored Content
Top Forums Shell Programming and Scripting Add a character C in a column if that column is blank Post 302846959 by Scrutinizer on Monday 26th of August 2013 04:15:36 AM
Old 08-26-2013
Hi thejitha,

So did you try:
Code:
awk '{a=substr($0, 17, 1); a=(a~/[[:alpha:]]/)?a:"C"; print substr($0,1, 16) a substr($0,18)}' file

What result did you get? Were you using your sample as input?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse 1 column and add 2nd column

I'm racking my brain on this one! :( I have a list like this: Paul 20 Paul 25 Paul 30 Frank 10 Julie 15 Julie 13 etc, etc... I've been trying to figure out a way to have the output display the name in the first column ONCE and add the numbers in the second column and display that... (2 Replies)
Discussion started by: sdlennon
2 Replies

2. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

3. Shell Programming and Scripting

Need to add letters to a column and add in a new column subtracting from another column

So I have this input 1 10327 rs112750067 T C . PASS DP=65;AF=0.208;CB=BC,NCBI 1 10469 rs117577454 C G . PASS DP=2055;AF=0.020;CB=UM,BC,NCBI 1 10492 rs55998931 C T . PASS DP=231;AF=0.167;CB=BC,NCBI 1 10583 rs58108140 G A ... (3 Replies)
Discussion started by: kellywilliams
3 Replies

4. Shell Programming and Scripting

to add special tag to a column based on column condition

Hi All, I have following html code <TR><TD>9</TD><TD>AR_TVR_TBS </TD><TD>85000</TD><TD>39938</TD><TD>54212</TD><TD>46</TD></TR> <TR><TD>10</TD><TD>ASCV_SMY_TBS </TD><TD>69880</TD><TD>33316</TD><TD>45698</TD><TD>47</TD></TR> <TR><TD>11</TD><TD>ARC_TBS ... (9 Replies)
Discussion started by: ckwan
9 Replies

5. Shell Programming and Scripting

Remove the first character from the fourth column only if the column has four characters

I have a file as follows ATOM 5181 N AMET K 406 12.440 6.552 25.691 0.50 7.37 N ATOM 5182 CA AMET K 406 13.685 5.798 25.578 0.50 5.87 C ATOM 5183 C AMET K 406 14.045 5.179 26.909 0.50 5.07 C ATOM 5184 O MET K... (14 Replies)
Discussion started by: hasanabdulla
14 Replies

6. Shell Programming and Scripting

Add all 4 column entries for similar column ids

Hi, I want to write a script which will add the entries in all columns for the same column id. I can do it in excel, but I need to do this for 384 columns which will come down to 96 (384/4). How can I do this iteratively A A A A B B B B C C C C 1 0 1 0 2 1 4 5 3 4 5 6 2 0 0 2 3 5 70 100 1... (7 Replies)
Discussion started by: Diya123
7 Replies

7. Shell Programming and Scripting

Insert data in first column(if blank) from previous line first column

Dear Team I need to insert field(which is need to taken from previous line's first field) in first column if its blank. I had tried using sed but not find the way. Detail input and output file as below. Kindly help for same. INPUT: SCGR SC DEV DEV1 NUMDEV DCP ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

8. Shell Programming and Scripting

Add Column base on other Column Data

HI Guys, I want add one extra Column base on 3rd Column . Input :- 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... (5 Replies)
Discussion started by: pareshkp
5 Replies

9. Shell Programming and Scripting

Split column when value in column is blank in any row

Hi Experts, In short : Need to split file when field in column 5 is blank and need to generate two file in which column 5 is blank and other in which column 5 has values along with other rows and column data My issue is i am not able to get header for column from raw file into new file which... (1 Reply)
Discussion started by: as7951
1 Replies

10. UNIX for Beginners Questions & Answers

Add column and multiply its result to all elements of another column

Input file is as follows: 1 | 6 2 | 7 3 | 8 4 | 9 5 | 10 Output reuired (sum of the first column $1*$2) 1 | 6 | 90 2 | 7 | 105 3 | 8 | 120 4 |9 | 135 5 |10 | 150 Please enclose sample input, sample output, and code... (5 Replies)
Discussion started by: Sagar Singh
5 Replies
mailq(1)						      General Commands Manual							  mailq(1)

NAME
mailq - prints the mail queue SYNOPSIS
DESCRIPTION
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, 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: to indicate that the job is being processed to indicate that the load is too high to process the job to indicate that the job is too new in the queue to process. The output lines that follow the second line show the message recipients, one per line. is identical to Options The supported options are: Show the mail submission queue specified in the file instead of the MTA queue specified in the file. Show the lost items in the mail queue instead of normal queue items. Show the quarantined items in the mail queue instead of the normal queue items. Limit processed jobs to those containing substr as a substring of the queue ID or not when is specified. Limit processed jobs to quarantined jobs containing substr as a substring of the quarantine reason or not when is specified. Limit processed jobs to those containing substr as a substring of one of the recipients or not when is specified. Limit processed jobs to those containing substr as a substring of the sender or not when is specified. 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. In addition, extra lines may be intermixed with the recipients indicating the `controlling user' information. This shows who owns the programs that are executed on behalf of this message and the name of the alias this command expanded from, if any. RETURN VALUE
The utility exits with 0 on success, and >0 if an error occurs. AUTHOR
was developed by the University of California, Berkeley, and originally appeared in 4.0BSD. FILES
mail queue files for SEE ALSO
sendmail(1M). mailq(1)
All times are GMT -4. The time now is 10:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy