10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is the task that I was presented with:
I am dealing with about a 10,000 line input deck file for an analysis. About 10 separate blocks of around 25 lines of code each need to be updated in the input deck.
The input deck (deckToChange in the code below) comes with 2 separate files. File 1... (5 Replies)
Discussion started by: tiktak292
2. Shell Programming and Scripting
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Discussion started by: Ferocci
3. Shell Programming and Scripting
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
4. Shell Programming and Scripting
Am confused with the usage of "sed" command
I want to replace a single line with multiple lines of a file..
A file has
Hi, How are you?
I need to replace as
What are You doing?
I used the script as
string1="Hi, How are you?"
echo "$string1 is the value"... (4 Replies)
Discussion started by: Priya Amaresh
5. UNIX for Dummies Questions & Answers
I have a file with below content :
I need to replace the lines which have a and b continuously by d.
I have used the below code
tr '\n' '#'<file|sed. 's/a#b/d/g's?|tr '#' '\n' where # is not occurring anywhere in the file..
Is there any other efficient way to do this?
... (7 Replies)
Discussion started by: pandeesh
6. Shell Programming and Scripting
I have an xml file that is stripped down to output that looks bacically like;
<!-- TABLEA header -->
<!-- TABLEB header -->
<!-- TABLEC header -->
I want to remove the header... (3 Replies)
Discussion started by: Griffs_Revenge
7. Shell Programming and Scripting
As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2
0.723 (12 Replies)
Discussion started by: f_o_555
8. Shell Programming and Scripting
Regards of the Day.
I have a text file with some functions:
} (1 Reply)
Discussion started by: ashisharora
9. Shell Programming and Scripting
Can any one give me the idea on replacing multiple blank lines with a single blank line?
Please conside it for a file having more than 100 number of characters.
Siba (3 Replies)
Discussion started by: siba.s.nayak
10. Shell Programming and Scripting
I have a file which has the lines
# Serial number for hostid
These lines could be anywhere in the file as far as line numbers go, I would like replace these two lines with
# Serial number for hostid $var1
Is there a quick and simple... (6 Replies)
Discussion started by: hcclnoodles