Sponsored Content
Top Forums Shell Programming and Scripting How to make spaces in between? Post 302982357 by RavinderSingh13 on Wednesday 28th of September 2016 10:20:25 AM
Old 09-28-2016
Hello Ernesto,

Could you please try following and let me know if this helps you. But Input_file should be same as shown sample Input_file(ditto exact) else it would provide different output too.
Code:
awk '{sub(/[0-9]+/,X,$0);match($0,/[[:alpha:]]+[[:digit:]]+/);ID=substr($0,RSTART,RLENGTH);DES=substr($0,RLENGTH+1);match(DES,/[a-zA-Z]+/);NAME=substr(DES,RSTART,RLENGTH);gsub(/.* |Active.*/,X,DES);sub(/[a-z]+/,"& ",NAME);VAL=ID FS NAME FS DES;gsub(/LEAD|MANGER/," &",VAL);print VAL}' Input_file

EDIT: Adding a non-one liner form of above solution too now.
Code:
awk '{
        sub(/[0-9]+/,X,$0);
        match($0,/[[:alpha:]]+[[:digit:]]+/);
        ID=substr($0,RSTART,RLENGTH);
        DES=substr($0,RLENGTH+1);
        match(DES,/[a-zA-Z]+/);
        NAME=substr(DES,RSTART,RLENGTH);
        gsub(/.* |Active.*/,X,DES);
        sub(/[a-z]+/,"& ",NAME);
        VAL=ID FS NAME FS DES;
        gsub(/LEAD|MANGER/," &",VAL);
        print VAL
     }
    '   Input_file

Thanks,
R. Singh

Last edited by RavinderSingh13; 09-28-2016 at 11:29 AM.. Reason: Adding a non-one liner form of above solution successfully too now.
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

make and make install commands

Hi there, I am installing a package at the moment on to my Solaris version 8 and I have run into a problem with the 'make' command. I have installed the package using the 'pkgadd' command and I am now at the stage where I have to use the 'make' command followed by the 'make install'... (4 Replies)
Discussion started by: gerwhelan
4 Replies

2. Shell Programming and Scripting

Strip leading and trailing spaces only in a shell variable with embedded spaces

I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help. echo $SH_VAR | command_line Syntax. The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies

3. Linux

Error in issuing a make and make install

Hi, Recently I install a package and try to do a make and make install. However, in the make it gives me below error:- make:Nothing to be done for 'install-exec-am' make:Nothing to be done for 'install-data-am' Can anyone please explain to me what does this mean? I have been trying... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

4. UNIX for Dummies Questions & Answers

how to append spaces(say 10 spaces) at the end of each line based on the length of th

Hi, I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is. I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies

5. Shell Programming and Scripting

Removing blank spaces, tab spaces from file

Hello All, I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out. My file is like this (<b> means one blank space, <t> means one tab space)- $ cat file NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies

6. Solaris

Gani Network Driver Won't Install - make: Fatal error: Don't know how to make targ...

I attached a README file that I will refer to. I successfully completed everything in the README file until step 4. # pwd /gani/gani-2.4.4 # ls COPYING Makefile.macros gem.c Makefile Makefile.sparc_gcc gem.h Makefile.amd64_gcc ... (1 Reply)
Discussion started by: Bradj47
1 Replies

7. UNIX for Dummies Questions & Answers

Difference between configure/make/make install.

Hi, While installation of apache on linux, we perform the below tasks. 1) Untar 2) configure 3) make 4) make install. I wanted to understand the difference and working of configure/make/make install. Can any one help me understanding this? Thanks in advance. (1 Reply)
Discussion started by: praveen_b744
1 Replies

8. Programming

Issue with make, no rule to make target etc.

I have been trying to split up my src directory to clear out files that are not re-compiled very often. Now I have the following setup in my trunk, trunk/bld trunk/src/ trunk/src/src_server trunk/makefile.linux In the make file, I have compile rules SOURCELOC = src # compile src c++... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

9. Shell Programming and Scripting

Append spaces the rows to make it into a required fixed length file

I want to make a script to read row by row and find its length. If the length is less than my required length then i hav to append spaces to that paritucular row. Each row contains special characters, spaces, etc. For example my file contains , 12345 abcdef 234 abcde 89012 abcdefgh ... (10 Replies)
Discussion started by: Amrutha24
10 Replies

10. Shell Programming and Scripting

How to add extra spaces to make all lines the same length?

Hello to all, I'm trying to format a file to have all lines with the same length (the length of the longest line) adding needed extra spaces at the end. Currently I have the awk script below that adds one space the end of each that have a lenght lower than 35, but I don't know how to add... (3 Replies)
Discussion started by: Ophiuchus
3 Replies
gts2oogl(1)						  GNU Triangulated Surface utils					       gts2oogl(1)

NAME
gts2oogl - converts a GTS file to OOGL file format (Geomview). SYNOPSIS
gts2oogl [OPTIONS] < input.srf > output.oogl DESCRIPTION
This manual page documents briefly the gts2oogl command. OPTIONS
This program follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -G, --gnuplot Writes isolines in gnuplot format. --component Color faces according to the component they belong too. --quality Color faces according to their quality. --area Color faces according to their area. --incomp Color incompatible faces. -f VAL, --fold=VAL Color faces which make an angle smaller than VAL degrees with any of their neighbors. -t, --faces Output individual faces. --epv Color vertices according to number of edges per vertex. -H C, --height=C Color vertices according to their C coordinate. -g, --gaussian Color vertices according to Gaussian curvature. -C, --curvature Color vertices according to mean curvature. --boundary Output boundary edges. -e A, --feature=A Output `feature' edges defined by angle A. --non-manifold Output non-manifold edges. --duplicate Output duplicate edges. -i N, --isolines=N Draw N isolines (levels of constant altitude). -I L, --isolines=L Draw isoline at level L. --cmap=FILE Load FILE as colormap. -m VAL, --min=VAL Use VAL as minimum scaling value. -M VAL, --max=VAL Use VAL as maximum scaling value. -r, --reverse Reverse colormap. -n, --nosurface Do not output surface. -F C, --flatten=C Set C coordinate to average value. -v, --verbose Display surface statistics. -h, --help Display the help and exit. AUTHOR
gts2oogl was written by Stephane Pipinet <popinet@users.sourceforge.net>. This manual page was written by Ruben Molina <rmolina@udea.edu.co>, for the Debian project (but may be used by others). June 2, 2008 gts2oogl(1)
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy