Sponsored Content
Top Forums Shell Programming and Scripting Replacing lines in text files Post 302162313 by vgersh99 on Monday 28th of January 2008 05:36:25 PM
Old 01-28-2008
Quote:
Originally Posted by KevinADC
But if you have # in the lines you will get the same problem. Does sed not have a quotemeta function/option you can use for more general purposes and not have to worry about the specific delimiter in the search expression?
not that I'm aware of......
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to delete first 5 lines and last five lines in all text files

Hi I want to delete first five and last five lines in text files without opening the file and also i want to keep the same file name for all the files. Thanks in advance!!! Ragav (10 Replies)
Discussion started by: ragavendran31
10 Replies

2. Shell Programming and Scripting

replacing new lines in all files of a directory containing old lines

Hi all, I am trying to replace a few lines with other lines of all files in a directory which contain those few lines. say - there are some 10 files in a dir having the same 4 lines as 1.txt at the starting 1.txt line 1 line 2 line 3 line 4 ....................................... (1 Reply)
Discussion started by: rooster005
1 Replies

3. Shell Programming and Scripting

sed: Replacing two lines of text

I just created a file in vi, looks like this: Hello nobody nobody What I need is to have sed change the file so it looks like this: Hello everybody In other words, the sed query needs to look for both instances of "nobody" before it puts the word "everybody" on the first line. ... (2 Replies)
Discussion started by: calrog
2 Replies

4. Shell Programming and Scripting

Replacing Block of lines in a text file

Dear All, Regards of the Day. I have a text file with some functions: Function1 { parameter 1 parameter 2 parameter 3 } end Function2 { parameter 1 parameter 2 parameter 3 } (1 Reply)
Discussion started by: ashisharora
1 Replies

5. Shell Programming and Scripting

Replacing lines between two files with awk

Hello Masters, I have two subtitles file with different language like below First file : 1 00:00:41,136 --> 00:00:43,900 2 00:00:55,383 --> 00:00:58,477 <i> Ladies and gentlemen,</i> <i>this is Simon Barsinister,</i> 3 00:00:58,553 --> 00:01:00,521 <i>the wickedest man in the... (8 Replies)
Discussion started by: rk4k
8 Replies

6. Shell Programming and Scripting

Unix Script for replacing text in files

Dear Experts, I am new to unix shell programming. I need to write a script which needs to edit 4 text files. File 1:- PCH_Test.txt File 2:- PCT_Test.txt File 3:- PCY_Test.txt File 4:- PCW_Test.txt PCH_Test.txt First it needs to get into PCH_Test file and prefix the 6th coloumn... (2 Replies)
Discussion started by: phani333
2 Replies

7. Shell Programming and Scripting

Extended replacing of nonspecific strings in text files [beware complicated !]

Well, to make another post at this helpful forum :b::D: I recently tried something like this, I want to replace all those numberings/letters that are located between <string>file://localhost/var/mobile/Applications/ and /Documents/</string> numberings =---- replace with: first... (6 Replies)
Discussion started by: pasc
6 Replies

8. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum using sed, awk

Hi friends, This is sed & awk type question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example ###start of input text file #### abc def ghi 1 2 3 4 kjld random... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

9. Shell Programming and Scripting

Finding a text in files & replacing it with unique strings

Hallo Everyone. I have to admit I'm shell scripting illiterate . I need to find certain strings in several text files and replace each of the string by unique & corresponding text. I prepared a csv file with 3 columns: <filename>;<old_pattern>;<new_pattern> ... (5 Replies)
Discussion started by: gordom
5 Replies

10. Shell Programming and Scripting

Read n lines from a text files getting n from within the text file

I dont even have a sample script cause I dont know where to start from. My data lookes like this > sat#16 #data: 15 site:UNZA baseline: 205.9151 0.008 -165.2465 35.8109 40.6685 21.9148 121.1446 26.4629 -18.4976 33.8722 0.017 -165.2243 48.2201 40.6908 ... (8 Replies)
Discussion started by: malandisa
8 Replies
GENCAT(1)						    BSD General Commands Manual 						 GENCAT(1)

NAME
gencat -- NLS catalog compiler SYNOPSIS
gencat output-file input-files... DESCRIPTION
The gencat utility merges the text NLS input files input-files... into a formatted message catalog file output-file. The file output-file will be created if it does not already exist. If output-file does exist, its messages will be included in the new output-file. If set and message numbers collide, the new message text defined in input-files... will replace the old message text currently contained in output-file. INPUT FILES
The format of a message text source file is defined below. Note that the fields of a message text source line are separated by a single space character: any other space characters are considered to be part of the field contents. $set n comment This line specifies the set identifier of the following messages until the next $set or end-of-file appears. The argument n is the set identifier which is defined as a number in the range [1, (NL_SETMAX)]. Set identifiers must occur in ascending order within a single source file, but need not be contiguous. Any string following a space following the set identifier is treated as a comment. If no $set directive is specified in a given source file, all messages will be located in the default message set NL_SETD. $del n comment This line deletes messages from set n from a message catalog. The n specifies a set number. Any string following a space following the set number is treated as a comment. $ comment A line beginning with $ followed by a space is treated as a comment. m message-text A message line consists of a message identifier m in the range [1, (NL_MSGMAX)]. The message-text is stored in the message catalog with the set identifier specified by the last $set directive, and the message identifier m. If the message-text is empty, and there is a space character following the message identifier, an empty string is stored in the message catalog. If the message-text is empty, and if there is no space character following the message identifier, then the existing message in the current set with the specified message identifier is deleted from the catalog. Message identifiers must be in ascending order within a single set, but need not be contiguous. The message-text length must be in the range [0, (NL_TEXTMAX)]. $quote c This line specifies an optional quote character c which can be used to surround message-text so that trailing space or empty messages are visible in message source files. By default, or if an empty $quote directive is specified, no quoting of message-text will be rec- ognized. Empty lines in message source files are ignored. The effect of lines beginning with any character other than those described above is unde- fined. Text strings can contain the following special characters and escape sequences. In addition, if a quote character is defined, it may be escaped as well to embed a literal quote character. line feed horizontal tab v vertical tab  backspace carriage return f form feed \ backslash ooo octal number in the range [000, 377] A backslash character immediately before the end of the line in a file is used to continue the line onto the next line, e.g.: 1 This line is continued on this line. If the character following the backslash is not one of those specified, the backslash is ignored. EXIT STATUS
The gencat utility exits 0 on success, and >0 if an error occurs. SEE ALSO
catclose(3), catgets(3), catopen(3) STANDARDS
The gencat utility is compliant with the X/Open Portability Guide Issue 4 (``XPG4'') standard. AUTHORS
This manual page was originally written by Ken Stailey and later revised by Terry Lambert. BUGS
A message catalog file created from a blank input file cannot be revised; it must be deleted and recreated. BSD
June 11, 1997 BSD
All times are GMT -4. The time now is 05:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy