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
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:
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.
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)
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)
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)
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)
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)
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)
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)