06-18-2010
How to use 'sed' add 'zero' only before the single number?
input numbers in random:
11 2 3 44 5 66 7 8 99 0 11 2 3 44 5
output should looks like this:
11 02 03 44 05 66 07 08 99 00 11 02 03 44 05
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Greetings,
I have a file: hostnames.txt which has -
# cat hostnames.txt
machine1
machine2
I need the output to be saved to a variable as:
HOSTNAMELIST=machine1,machine2
Please advise.
Thanks,
Chiru (3 Replies)
Discussion started by: chiru_h
3 Replies
2. Shell Programming and Scripting
Hi all,
I have a file with little blocks beginning with a number 761XXXXXX, and 0, 1, 2 or 3 lines below of it beginning with STUS as follow:
761625820
STUS ACTIVE 16778294
STUS NOT ACTIVE
761157389
STUS ACTIVE 16778294
761554921
STUS ACTIVE 16778294
STUS NOT ACTIVE
STUS ACTIVE OP... (4 Replies)
Discussion started by: cgkmal
4 Replies
3. Shell Programming and Scripting
Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count
The input file:
21 2341 A
21 2341 A
21 2341 A
21 2341 C
21 2341 C
21 2341 C
21 2341 C
21 4567 A
21 4567 A
21 4567 C
... (6 Replies)
Discussion started by: juelillo
6 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a file which has bind varaiables like :1,:2 till :500.
I need to replace all these bind variables to word 'sysdate-3'
Whats the command I can use to do this.
Thanks (1 Reply)
Discussion started by: prashanth_gs
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am new to unix. we have a requirement here to split a single file into multiples files based on the number of people available for processing. So i tried my hand at writing some code as below.
#!/bin/bash
var1=`wc -l $filename`
var2=$var1/$splitno
split -l $var2 $1
Please help me... (6 Replies)
Discussion started by: quirkguy
6 Replies
6. Shell Programming and Scripting
Hey guys, I have a column that consists of string and integer values without a distinctive deliminator, looking like this...
7ASA
14LAL
245FOO
656MOM
87577DAD
...
I want to split the column into two columns, one containing the numbers and one containing the text part.
edit: numbers... (3 Replies)
Discussion started by: origamisven
3 Replies
7. UNIX for Dummies Questions & Answers
I have a text file with 1,000,000 rows (It is a single column text file of numbers). I would like to separate the text file into 100 files of equal size (i.e. number of rows). The first file will contain the first 10,000 rows, the second row will contain the second 10,000 rows (rows 10,001-20,000)... (2 Replies)
Discussion started by: evelibertine
2 Replies
8. Shell Programming and Scripting
I have one configuration file. The number of lines in the file will vary. I need to pass each line as a parameter to a shell script in a single shot.
Ex:
Suppose file contains:
ou=x,o=z
o=y
Suppose the shell script name is sample.sh. Then the script should be called like sample.sh ou=x.o=z... (6 Replies)
Discussion started by: saurabhkoar
6 Replies
9. Shell Programming and Scripting
i need to be able to count the number of single quotes ' in the entire string below:
"description":"DevOps- Test VM's, System Admins Test VM's ",
awk can most likely do this, but here's my attempt using egrep:
echo "${STRING}" | egrep -wc '"'"\'"'"'
or
echo "${STRING}" | egrep -wc... (11 Replies)
Discussion started by: SkySmart
11 Replies
10. HP-UX
Hi All,
When i was trying to get total number of threads per java process using this command ps -o NLWP PID, I'm not getting any output. Could someone help me in this issue.
Thanks,
GMar (1 Reply)
Discussion started by: mgangumolu
1 Replies