Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find string multiple times, same line Post 302538020 by shamrock on Monday 11th of July 2011 01:04:21 PM
Old 07-11-2011
Are you looking for files or strings within lines of a file.
This User Gave Thanks to shamrock For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

matching multiple times in same line

Hi, I am stuck with pattern matching. I need to match a particular pattern several times in a same line and replace them. for ex., I need to convert (abc XY) (bvf ZY) bla bla to XY ZY bla bla I tried.. s/\(+ (.+)\)/$1/gi and it works (2 Replies)
Discussion started by: oldtrash
2 Replies

2. Shell Programming and Scripting

Find multiple string in one file using find command

Hi, I want find multiple string in one file using find coomand. And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies

3. Shell Programming and Scripting

Find a line using a condition and replace a string in that line

Hello, I have a 100 line code. I have given a sample of it below: ABC*654654*1*54.54*21.2*87*1*654654654654 CCC*FS*FS*SFD*DSF GGG*FGH*CGB*FBDFG*FGDG ABC*654654*1*57.84*45.4*88*2*6546546545 CCC*WSF*SG*FGH*GHJ ADA*AF*SFG*DFGH*FGH*FGTH I need to select the line starting with "ABC" its... (6 Replies)
Discussion started by: nithins007
6 Replies

4. Emergency UNIX and Linux Support

Find a line using a condition and replace a string in that line

Hello, I have a 100 line code. I have given a sample of it below: ABC*654654*1*54.54*21.2*87*1*654654654654 CCC*FS*FS*SFD*DSF GGG*FGH*CGB*FBDFG*FGDG ABC*654654*1*57.84*45.4*88*2*6546546545 CCC*WSF*SG*FGH*GHJ ADA*AF*SFG*DFGH*FGH*FGTH I need to select the line starting with "ABC" its... (3 Replies)
Discussion started by: nithins007
3 Replies

5. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

6. Shell Programming and Scripting

Sed replace using same pattern repeating multiple times in a line

Sed replace using same pattern repeating multiple times in a line I have text like below in a file: I am trying to replace the above line to following How can I acheive this? I am able to do it if the occurrence is for 1 time: But If I try like below I am getting like this: I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies

7. Shell Programming and Scripting

awk to find lines containing word that occur multiple times

i have a script that scans a log file every 10 minutes. this script remembers the last line of the log and then uses it to continue monitoring the log when it runs again 10 minutes later. the script searches the log for a string called MaxClients. now, how can i make it so that when the... (7 Replies)
Discussion started by: SkySmart
7 Replies

8. UNIX for Advanced & Expert Users

How to find a string in a line in UNIX file and delete that line and previous 3 lines ?

Hi , i have a file with data as below.This is same file. But actual file contains to many rows. i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ? Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies

9. Shell Programming and Scripting

Find word in a line and output in which line the word occurs / no. of times it occurred

I have a file: file.txt, which contains the following data in it. This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt My name is not Karl, my name is Karl Joey What is your name? Do you know your name and... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

10. UNIX for Dummies Questions & Answers

Replace string and create new file multiple times

First of all, apologies if this has already been answered elsewhere. I haven't quite been able to find what I'm looking for yet, so hopefully this won't come across as repetition. I have a file consisting of ~100 nearly identical lines, each of which contains multiple instances of the string I... (11 Replies)
Discussion started by: pseudo.seppuku
11 Replies
textpack(1)						      General Commands Manual						       textpack(1)

NAME
textpack - Pack and unpack Flex files containing text SYNOPSIS
textpack -c FLEXFILE [TEXTFILE] textpack -x FLEXFILE [TEXTFILE] DESCRIPTION
Text Flex files are used for the storage of strings by the games Exult supports. While expack(1) can operate on such files, using textpack to pack and unpack them is more comfortable. The first parameter determines the mode of operation, -c stands for creation, -x for extraction. Creation TEXTFILE (or stdin if it is missing) is read and must conform to the file format (see below). FLEXFILE will be created containing the strings from this input. Extraction The strings contained in FLEXFILE are extracted and written to TEXTFILE (if given, stdout otherwise) in the file format documented below. File Format Empty lines, and lines starting with a pound sign (#) are ignored. Other lines must begin with a number, followed by a colon (:). The num- ber is the index of the string and may be given either in decimal, in octal prefixed with 0; or in hexadecimal prefixed with 0x. Anything following the colon belongs to the string and gets stored in the Flex verbatim. Lines are limited in length to 1024 characters. EXAMPLES
textpack -x text.flx Writes all the strings contained in text.flx to stdout in the format discussed above. textpack -c text.flx strings.list Reads strings.list and puts its contents into the Flex file text.flx Example text file # An example 0:the zeroth string # strings may be empty 1: # holes are allowed, strings 2 to 16 will be empty 17:string seventeen # 13 hexadecimal == 19 decimal, 24 octal == 20 decimal 0x13:nineteen 024:twenty # numbers need not go up 18:eighteen # this will overwrite the definition from above 19:overwritten AUTHOR
This manpage was written by Robert Bihlmeyer. It may be freely redistributed and modified under the terms of the GNU General Public License version 2 or higher. SEE ALSO
expack(1), exult(6) Exult 2002-03-24 textpack(1)
All times are GMT -4. The time now is 03:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy