Sponsored Content
Full Discussion: column space
Operating Systems AIX column space Post 302213111 by bakunin on Wednesday 9th of July 2008 08:36:26 AM
Old 07-09-2008
I am going to transfer this thread to the "shell scripting" forum, as it belongs there.

If the input varies, as you say, you have to find a constant pattern to express it. If - for instance - the place where you want to insert a second space is the first place where a "3" and a "5" are separated by a blank then the expression to match this would be

Code:
sed 's/3 5/3  5/'

which would mean "search for the first occurrence of "3-space-5" and replace it with "3-space-space-5".

If, also for example, it is the space between the first two "words" in a line, than the expression would have to be:

Code:
sed 's/ /  /'

This means: search for the first occurrence of "space" and replace it by "space-space". This way "xxx-space-xxx" would become "xxx-space-space-xxx" and "xxxxxx-space-xx" would become ""xxxxxx-space-space-xx".

And so on and so forth. get a book about regular expressions and it will teach you how to do that.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with script printing column with space

I am having some issues with a script taking in column #5 which has a space and splitting it into another line. I don't want this but I can not figure out why its doing this. Any help is appreciated. Here is my input file (comma delimited): ... (4 Replies)
Discussion started by: n3al10
4 Replies

2. UNIX for Dummies Questions & Answers

Combining three space delimited files by column

I have three space delimited files, how do I combine them by column in Unix? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

3. Shell Programming and Scripting

Delete Space between last and first column

HI Input A R04 tion=1 Li 51599 R08 tiea=1 Li 51995 R11 ocatea=1 Li 51992 R12 nArea=1 Li ... (2 Replies)
Discussion started by: asavaliya
2 Replies

4. Shell Programming and Scripting

Padding space with each column

Hi How do I a add space with each column . Each column has fixed size like 1 st column = 10 2nd column = 20 In each column data can be of variable length.So rest of the length should be space Frank Student Sue Admin (3 Replies)
Discussion started by: Chinky23
3 Replies

5. Shell Programming and Scripting

Reading first column of file which start with space also

Hi All, I am trying to read first column of my file using command cat temp2_sample.cir|cut -d' ' -f1 The content of my file is as follow R1 pin23I pin27I R2 pin23G pin27G R3 pin27F pin27D RWire10 pin15Y pin23J VCC1 pin27W pin13Y ... (6 Replies)
Discussion started by: diehard
6 Replies

6. Shell Programming and Scripting

Insert space in specific column among many columns

Hello, I have some problem in inserting the space for the pairs of columns. I have the input file : I used this code below in replacing it using space in specific column (replace space in each two columns) sed -e "s/,/ /2" -e "s/,/ /3" inputfile Output showed : However, I have many... (3 Replies)
Discussion started by: awil
3 Replies

7. Shell Programming and Scripting

Change some string in specific column with space

Hello All of Master Script , i need help to solve my problem before : mount /dev/rdsk/c1t69d0s6 /dev/rdsk/c1t69d0s6 /vol/cl123/PURGE1 ufs mount /dev/rdsk/c1t70d0s6 /dev/rdsk/c1t70d0s6 /vol/cl123/PURGE2 ufs expected : mount /dev/dsk/c1t69d0s6 /dev/rdsk/c1t69d0s6 /PURGE1 ufs mount ... (3 Replies)
Discussion started by: k0p0nkkk
3 Replies

8. Shell Programming and Scripting

Remove of white space when you have multiple column

i have file in which i want to remove white space from each column where ever it exist there is white space at the end of line. i know how to remove white space if i have only 1 column, but i have multiple columns and white space can be in any column. sed 's/ *$//' file ath-miRf10005-akr... (5 Replies)
Discussion started by: mirwasim
5 Replies

9. 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

10. UNIX for Beginners Questions & Answers

Create the space only in the Third column by awk

Hi All , I am having an input file like this Input file r s e y Pin Numbers s n eppppppppppppppppppc ... (3 Replies)
Discussion started by: kshitij
3 Replies
DB2_FIELD_NAME(3)							 1							 DB2_FIELD_NAME(3)

db2_field_name - Returns the name of the column in the result set

SYNOPSIS
string db2_field_name (resource $stmt, mixed $column) DESCRIPTION
Returns the name of the specified column in the result set. PARAMETERS
o $stmt - Specifies a statement resource containing a result set. o $column - Specifies the column in the result set. This can either be an integer representing the 0-indexed position of the column, or a string containing the name of the column. RETURN VALUES
Returns a string containing the name of the specified column. If the specified column does not exist in the result set, db2_field_name(3) returns FALSE. SEE ALSO
db2_field_display_size(3), db2_field_num(3), db2_field_precision(3), db2_field_scale(3), db2_field_type(3), db2_field_width(3). PHP Documentation Group DB2_FIELD_NAME(3)
All times are GMT -4. The time now is 04:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy