10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I'm passing a variable to a scrpit which can be 1 to 3 characters long.
How can I force it to be three character long and add spaces to it?
The passed variable is stored in $1 and I would like to be stored in NewName
I tried without success
NewName=$(printf "%*s 3 $1)
So if... (2 Replies)
Discussion started by: f_o_555
2 Replies
2. UNIX for Dummies Questions & Answers
I want to keep string/varible length to 10 even its actual length is less than 10(may be no value). so, i want to add trailing spaces to my string. :wall:
"typeset -L10 myvarible" is not working, its saying invalid typset -L option.
Can you please advise. (4 Replies)
Discussion started by: djaks111
4 Replies
3. Shell Programming and Scripting
I have a tab-delimited file with three columns. They are arranged in blocks like this
1 1 8
1 2 3
1 3 7
1 4 4
1 5 7
2 1 9
2 2 4
...
I would like to add spaces so that the file looks like this:
1 1 8
1 2 3
1 3 7
1 4 4
1 5 7 (3 Replies)
Discussion started by: machinus
3 Replies
4. Shell Programming and Scripting
HI,
I have a file with lot of blank lines, how can I remove those using awk??
Thanks,
Shruthi (4 Replies)
Discussion started by: shruthidwh
4 Replies
5. Shell Programming and Scripting
Hey there, this is my first post and I'll try to explain my situation as best I can.Here is a sample of the input file:
ADO Sample.h,v ADO Sample 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
ADO SampleDoc.h,v ADO SampleDoc 2010-05-21... (3 Replies)
Discussion started by: rodan90
3 Replies
6. Shell Programming and Scripting
Hi
I have a file like:
one two three four five
six seven eight nine ten
and I'd like to get
one:two:three:four:five
I'm trying to do it with sed, but the problem is also that the spaces between the words are not constant.
Any idea please?
thanks
... (5 Replies)
Discussion started by: Dedalus
5 Replies
7. UNIX for Dummies Questions & Answers
Hello,
How do I adda two whitespaces at the begining of each lines between line 12 and line 90;
something like :12,90 ???
Thanks! (3 Replies)
Discussion started by: JCR
3 Replies
8. Shell Programming and Scripting
Hi All,
I just need to check for 'tabs' in my input file and need to replace all tabs into 'n' no. of spaces. Say for example if I give NO_OF_SPACE=5, then it should replace all tabs with 5 spaces
abc.in
#####
asdasdasd
\t\t\tasjkalskdl;asdsdjfksldfjklsdfxcmxm,cv... (2 Replies)
Discussion started by: askumarece
2 Replies
9. Shell Programming and Scripting
I have a file that contains...
elm,mail
elm,lisp,composer,cd,ls,cd,ls,cd,ls,zcat,|,tar,-xvf,ls,cd,ls,cd,ls,vi,ls,cd,ls,vi,elm,-f,ls,rm,ls,cd,ls,vi,vi,ls,vi,ls,cd,ls,elm,cd,ls,cd,ls,vi,vi,vi,ls,vi,ls,i,vi,ls,cp,cd,fg,ls,rm,cd,ls,-l,exit
elm,mail,biff,elm,biff,elm,elm
elm,ls
... (2 Replies)
Discussion started by: Bandit390
2 Replies
10. Shell Programming and Scripting
I need to add spaces in between characters in a string variable.
Is there a shortcut? I know you can remove the spaces with sed, but does sed have a way to add them?
Example:
I have: DATA01
I want it to be: D A T A 0 1
What I have done so far is to create a function... (4 Replies)
Discussion started by: heyindy06
4 Replies