10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am trying to
insert text at the beginning of every even number line
with awk
i can do it with odd number lines
with this command
awk 'NR%2{$0="some text "$0}1' filehow can i edit this command
thanks (5 Replies)
Discussion started by: bob123
5 Replies
2. Shell Programming and Scripting
Hi All,
I have a file which has data like
a,b
c,d
e,f
g,h
And I need to insert a new column at the begining with sequence no( 1 to n)
1,a,b
2,c,d
3,e,f
4,g,h
Please let me know how to acheive this in unix (3 Replies)
Discussion started by: weknowd
3 Replies
3. Shell Programming and Scripting
Hello to all,
I'm trying to separate the string "str" using a regex within match function.
The substrings that I want to separate, begin with 22, 23, 24 or 25 and followed by 12 or 14 characters. And I want to
replace 22 with MJS, 23 with UYT, 24 with WER and 25 with PIL.
For this string... (4 Replies)
Discussion started by: Ophiuchus
4 Replies
4. Shell Programming and Scripting
stupid question: trying to use sed to do the following...
$ echo '12345' | sed 's/./&./g'
1.2.3.4.5.
needed this instead: 1.2.3.4.5 but how? please advise (7 Replies)
Discussion started by: ux4me
7 Replies
5. Shell Programming and Scripting
Hi all,
I need help with the following scenario in ksh.
If the number of elements contained by arrayA is 11 I need to insert a zero as the element arrayA then print all arrayA elements separated by comma.
Appreciate your help. (9 Replies)
Discussion started by: ejianu
9 Replies
6. Shell Programming and Scripting
My input file:
Class
Number Position Range
1 Initial 50
1 Initial 50
2 Terminal 150
2 Terminal 20
2 Single 10
3 Single 20
4 Double 50
5 Initial 50
5 Initial 60
Class
Number... (11 Replies)
Discussion started by: patrick87
11 Replies
7. Shell Programming and Scripting
I need to insert the output of a script into a specific line number of a txt file.
I've read the Sed man page and searched the forums and it's not immediately clear how I would go about doing this. (4 Replies)
Discussion started by: pluto7777
4 Replies
8. Shell Programming and Scripting
I wrote a script to grep for a closing XML node. Then I need it to navigate up a line and insert some XML. Then go to the next occurrance. I have this
INSERT_NODE='<QUANTITATIVE NAME="'${QR_NAME}'" QUANT="1" />'
GREP_FOR='</JOB>'
TMP_FILE=/tmp/lineArray.$$
if ]; then
continue
else
... (7 Replies)
Discussion started by: J-Man
7 Replies
9. Shell Programming and Scripting
Hi,
I am new to unix shell shell scripting. I have a specific requirement where I need to append comma's based on the max number of column in the file.
Eg:
If my source file look something like this,
sengwa,china
tom,america,northamerica
smith,america
walter
My output file... (8 Replies)
Discussion started by: nicholas_ejn
8 Replies
10. Shell Programming and Scripting
Hi All :),
I am very new to unix. I am requiring ur help in developing shell script for below problem.
I have to replace the second field of file with values of array sequentially where first field is ValidateKeepVar
<File>
UT-ExtractField 1 | &LogEntry &Keep(DatatoValidate)... (3 Replies)
Discussion started by: rohiiit.sharma
3 Replies