Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Create the space only in the Third column by awk Post 303042137 by RudiC on Monday 16th of December 2019 06:59:52 AM
Old 12-16-2019
How about
Code:
awk 'NR == 1 {L = index ($0, "r") - 1} {T = substr ($0, L); gsub (/./, "& ", T);  print substr ($0, 1, L), T}' file
                              r                                     s       
                              e                                     y       
Pin Numbers                   s                                     n       
                              e p p p p p p p p p p p p p p p p p p c       
                              t a a a a a a a a a a a a a a a a a a h       
                              _ 3 3 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 r       
                              n 0 1 0 1 4 5 6 7 8 9 8 9 2 3 4 5 6 7 o       
pattern         offset   
scan0_core_p    2965          1 1 1 0 1 1 0 1 0 1 0 L L L L L H L L 0       
                                                              ^             
scan0_core_p    2967          1 1 1 1 1 0 1 0 1 1 1 H H L L L H L L 0       
                                                              ^             
scan0_core_p    2968          1 1 1 1 0 1 1 0 0 1 1 H L L L H H H L 0       
                                                              ^             
scan0_core_p    2976          1 1 1 1 0 1 1 1 1 0 0 L L H L L H H L 0       
                                                                              ^         
scan0_core_p    2977          1 1 1 1 1 0 1 1 1 1 0 L H H L L H L L 0       
                                                                        ^         
scan0_core_p    2978          1 1 1 0 0 0 1 0 1 1 0 H H L L L H L L 0       
                                                                  ^

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

column space

Is it possible to give spaces using unix commands at a particular column? eg: 123 56 89(input) 123 56 89(output) (4 Replies)
Discussion started by: rollthecoin
4 Replies

2. Filesystems, Disks and Memory

Create file for space Reserve

Hi All, I want to make a 3GB of space reserve on Solaris. Let me know whether there is a way by creating empty file of 3GB so that i can delete that file in future to utilize that space. Or any other better ways for space reserve. -Vinodh' Kumar (4 Replies)
Discussion started by: vino_hymi
4 Replies

3. Solaris

Create user with Restricted Space usage

Hi, What is the command or how to create a user with the restricted usage of space on a disk. Also let me know how to change the limit of the space size allotted in future for the same user. ~Vinodh Kumar V M (3 Replies)
Discussion started by: vino_hymi
3 Replies

4. Shell Programming and Scripting

AWK script to create max value of 3rd column, grouping by first column

Hi, I need an awk script (or whatever shell-construct) that would take data like below and get the max value of 3 column, when grouping by the 1st column. clientname,day-of-month,max-users ----------------------------------- client1,20120610,5 client2,20120610,2 client3,20120610,7... (3 Replies)
Discussion started by: ckmehta
3 Replies

5. UNIX for Advanced & Expert Users

Need to remove leading space from awk statement space from calculation

I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation? Here is my query: cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}' 02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies

6. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

7. Shell Programming and Scripting

Help needed to create a UNIX Space monitoring script

Hi All, Its urgent.. pls help me out.. I want to create a KSH which should generate a report with the list of users and the files larger than 5 GB created by them in a direcorty and send autogenerated e-mail to them. my input would be users list,directory path and the file size (say 5 GB) ... (11 Replies)
Discussion started by: anman0523
11 Replies

8. Shell Programming and Scripting

Create new rows for each column value with awk

Hi, I have the following type of data that is separated by tabs: -2 abandonar abandono abandonas abandona abandonamos abandonáis abandonan -4 abandonado abandonada abandonados abandonadas -2 abandona abandonos ... (1 Reply)
Discussion started by: owwow14
1 Replies

9. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

10. Shell Programming and Scripting

Space moving to next column (awk HTML)

Hi I have create a report and have converted the text output to HTML but in the output there is a sentence "The transaction was aborted by the user.", the spaces between this sentence is considered as separate column. How can I overcome the same? I am providing my code, text output and... (7 Replies)
Discussion started by: Dumpi16
7 Replies
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)
All times are GMT -4. The time now is 01:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy