Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search and replace to first occurrence of string Post 302072413 by sssow on Tuesday 2nd of May 2006 04:06:48 PM
Old 05-02-2006
sed -e "s/;u/;Average u/" filename

or
%s/;u/;Average u
in vi

Last edited by sssow; 05-02-2006 at 05:14 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. Shell Programming and Scripting

SED replace string by occurrence

hi all, I have a text file with following content PAGENUMBER asasasa asasasa PAGENUMBER sasasasasa PAGENUMBER using sed i want to replace PAGENUMBER by occurrence count eg 1 asasasa asasasa 2 sasasasasa 3 (4 Replies)
Discussion started by: uttamhoode
4 Replies

3. UNIX for Dummies Questions & Answers

Search for a string and replace the searched string in the same position in samefile

Hi All, My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
Discussion started by: ganesh_248
27 Replies

4. Shell Programming and Scripting

Search, replace string in file1 with string from (lookup table) file2?

Hello: I have another question. Please consider the following two sample, tab-delimited files: File_1: Abf1 YKL112w Abf1 YAL054c Abf1 YGL234w Ace2 YKL150w Ace2 YNL328c Cup9 YDR441c Cup9 YDR442w Cup9 YEL040w ... File 2: ... ABF1 YKL112W ACE2 YLR131C (9 Replies)
Discussion started by: gstuart
9 Replies

5. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

6. Shell Programming and Scripting

Replace x Number of String Occurrence with Sed

Ok, So I have a huge file that has over 12000 lines in it. in this file, there are 589 occurrences of the string "use five-minute-interval" spread in various areas in the file. How can i replace the the last 250 of the occurrences of "use five-minute-interval" with "use... (10 Replies)
Discussion started by: SkySmart
10 Replies

7. UNIX for Dummies Questions & Answers

Search for a string,delete the line and replace with new string in a file

Hi Everyone, I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file. I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies

8. AIX

Replace consecutive occurrence of string in same line

Hi All, I have a requirement to replace consecutive occurence of same string nedd to be replaced. Below is the input and desired output. Input: --------- 123.5|ABC|.|.|. 234.4|DEF|.|.|.|.|.| Output: --------- 123.5|ABC|||. 234.4|DEF||||| so basically "|.|" need to be replaced with... (9 Replies)
Discussion started by: ureddy
9 Replies

9. Shell Programming and Scripting

Replace first occurrence of a string in while loop

####Solved#### Hello, My aim is to replace searched string with incremented value under ubuntu 16.04. Example: aasasasas 9030 31wwo weopwoep weerasas 9030 ew31wo ieopwoep bbqqqsas 9030 ew3swo ieeopwoep ccsaqpas 9030 ewiro o2opwoep Expected: aasasasas 9030 31wwo weopwoep weerasas 9031... (2 Replies)
Discussion started by: baris35
2 Replies

10. UNIX for Beginners Questions & Answers

Search partial string in a file and replace the string - UNIX

I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this. string(Scenario 1)- user::r--,user::ourfrd:r-- String(Scenario 2)- user::r-- File **** # file: /local/Desktop/myfile # owner: me # group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
WNSTATS(7)							     WordNettm								WNSTATS(7)

NAME
wnstats - WordNet 3.0 database statistics DESCRIPTION
Number of words, synsets, and senses +----------+---------+---------+------------------+ | POS | Unique | Synsets | Total | | | Strings | | Word-Sense Pairs | +----------+---------+---------+------------------+ |Noun | 117798 | 82115 | 146312 | |Verb | 11529 | 13767 | 25047 | |Adjective | 21479 | 18156 | 30002 | |Adverb | 4481 | 3621 | 5580 | +----------+---------+---------+------------------+ |Totals | 155287 | 117659 | 206941 | +----------+---------+---------+------------------+ Polysemy information +----------+------------------+------------+------------+ | POS | Monosemous | Polysemous | Polysemous | | | Words and Senses | Words | Senses | +----------+------------------+------------+------------+ |Noun | 101863 | 15935 | 44449 | |Verb | 6277 | 5252 | 18770 | |Adjective | 16503 | 4976 | 14399 | |Adverb | 3748 | 733 | 1832 | +----------+------------------+------------+------------+ |Totals | 128391 | 26896 | 79450 | +----------+------------------+------------+------------+ +----------+----------------------------+----------------------------+ | POS | Average Polysemy | Average Polysemy | | | Including Monosemous Words | Excluding Monosemous Words | +----------+----------------------------+----------------------------+ |Noun | 1.24 | 2.79 | |Verb | 2.17 | 3.57 | |Adjective | 1.40 | 2.71 | |Adverb | 1.25 | 2.50 | +----------+----------------------------+----------------------------+ NOTES
Statistics for all types of adjectives and adjective satellites are combined. The total of all unique noun, verb, adjective, and adverb strings is actually 147278. However, many strings are unique within a syntactic category, but are in more than one syntactic category. The figures in the table represent the unique strings in each syntactic category. WordNet 3.0 Dec 2006 WNSTATS(7)
All times are GMT -4. The time now is 10:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy