10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file with 100 lines. On 50 th line , from position 5 to rest of the data , I need to change the occurrence of A to B and Occurrence of M to N.
Input file :
Line1
Line2
Line3
--
--
12345ABCDEFM
---
--
Line 100
Output
Line1
Line2 (40 Replies)
Discussion started by: Rajesh_us
40 Replies
2. Shell Programming and Scripting
Hi,
I have a file where I want to replace the 15th field separated by comma, only on specific lines matching lots of different conditions.
I have managed to read the file line by line, within the loop my line is held in a variable called $line
I assume this will be using sed (maybe... (5 Replies)
Discussion started by: jpt123
5 Replies
3. Shell Programming and Scripting
Hi..wanted a help regarding inserting a newline in an xml file using shell script.
i've an xml file which has the following data.
1. <?xml version="1.0" encoding="UTF-8"?>
2. <group>
3. <name>odcm</name>
4. contd....
I need to insert two new lines after line#2, so that the output... (14 Replies)
Discussion started by: arjun_arippa
14 Replies
4. Shell Programming and Scripting
Hi,
How can i split a line of string into two lines.
I would like to format the below string:
Filesystem 1M-blocks Used Available Use% Mounted on /abc/def/xyz 34567 2345 12345 90% /test
to
Filesystem 1M-blocks Used Available Use% Mounted on
/abc/def/xyz 34567 2345 12345 90% /test
... (4 Replies)
Discussion started by: stunnerz_84
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Ive spent ages trying to find an explanation for how to do this on the web, but now feel like I'm :wall:
I would like to change each occurence (there are many within my script) of the following:
to
in Vim. I know how to search and replace when it is just single lines... (2 Replies)
Discussion started by: blueade7
2 Replies
6. Shell Programming and Scripting
Hi ,
I need some help on perl/sed conditional replacement
The situation is like below .
I have a file contents like below .
AAA|BBB|CCC|DDD
AAA|BCF|CCC|HHH
AAA|BVF|JJJ|KKK
Here in the above file . I know my second column value (taking "|" as my delimited )
Basically I have to... (3 Replies)
Discussion started by: robin.r888
3 Replies
7. Shell Programming and Scripting
I am doing a simple SHOW DATABASES query:
#!/bin/bash
echo `mysql -e "SHOW DATABASES;"`
It produces this:
Database information_schema mysql test
There are 2 things I want to do, but failing at.
1. Exclude the header "Database information_schema"
2. add a new line between each... (7 Replies)
Discussion started by: netfrugal
7 Replies
8. Shell Programming and Scripting
I have a file called config.xml, it's a simple xml file, and I need use sed/awk to erase some lines.
<machine xsi:type="unix-machineType">
<name>server1</name>
<node-manager>
<name>server1</name>
<listen-address>server1</listen-address>
</node-manager>
... (3 Replies)
Discussion started by: cbo0485
3 Replies
9. Shell Programming and Scripting
You guys are really smart, so I'm hoping someone can help me out with this. I would like to match the third line occurrence of a pattern at the beginning of a line in a file and replace it. I'm ok at using sed but I have no clue about this one. Thanks in advance. (5 Replies)
Discussion started by: sirokket16
5 Replies
10. Shell Programming and Scripting
How do I replace a space " " character at a particular position in a line?
e.g. I have a file below
$ cat i2
111 002 A a
33 0011 B c
2222 003 C a
I want all the 1st spaces to be replaced with forward slash "/" and the 3rd spaces to have 5 spaces to get the output below:
111/002... (8 Replies)
Discussion started by: stevefox
8 Replies