Sponsored Content
Full Discussion: Search string
Top Forums UNIX for Dummies Questions & Answers Search string Post 302399314 by vivekraj on Saturday 27th of February 2010 05:27:42 AM
Old 02-27-2010
You can also find the string by following way.

Code:
for fname in `ls book*`
do
echo -n $s:
sed -n '/[tT]itle/p' $s
done

I wrote above script for displaying the filenames and followed by colon as grep prints.

If we don't want to print the filenames,then simply the following command is enough.

Code:
sed -n '/[tT]itle/p' book*

 

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

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

3. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

4. Shell Programming and Scripting

Search several string and convert into a single line for each search string using awk command AIX?.

I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios. Cat test Nov 10, 2012 5:17:53 AM INFO: Request Type Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies

5. Shell Programming and Scripting

Search one string and then search another string in the next line

I am unable to use grep comman to Print only EmpPosition and if the EmpID next line. So output should be both EmpPosition and EmpID and also EmpPosition and EmpID data should match. Sample Data EmpPosition "New" EmpID "New" - - EmpPosition "New" ... (4 Replies)
Discussion started by: onesuri
4 Replies

6. Shell Programming and Scripting

Search a string in a text file and add another string at the particular position of a line

I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies

7. Shell Programming and Scripting

Search a string in a text file and add another string at the end of line

Dear All I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies

8. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

9. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies

10. UNIX for Beginners Questions & Answers

How to use a grep search to search for a specific string within multiple directories?

Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried: grep -lr "this string" * but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
OCONV(1)						      General Commands Manual							  OCONV(1)

NAME
oconv - create an octree from a RADIANCE scene description SYNOPSIS
oconv [ -i octree | -b xmin ymin zmin size ][ -n objlim ][ -r maxres ][ -f ][ -w ][ - ] [ input .. ] DESCRIPTION
Oconv adds each scene description input to octree and sends the result to the standard output. Each input can be either a file name, or a command (enclosed in quotes and preceded by a `!'). Similarly, the octree input may be given as a command preceded by a `!'. If any of the surfaces will not fit in octree, an error message is printed and the program aborts. If no octree is given, a new one is created large enough for all of the surfaces. The -b option allows the user to give a bounding cube for the scene, starting at xmin ymin zmin and having a side length size. If the cube does not contain all of the surfaces, an error results. The -b and -i options are mutually exclusive. The -n option specifies the maximum surface set size for each voxel. Larger numbers result in quicker octree generation, but potentially slower rendering. Smaller values may or may not produce faster renderings, since the default number (6) is close to optimal for most scenes. The -r option specifies the maximum octree resolution. This should be greater than or equal to the ratio of the largest and smallest dimensions in the scene (ie. surface size or distance between surfaces). The default is 16384. The -f option produces a frozen octree containing all the scene information. Normally, only a reference to the scene files is stored in the octree, and changes to those files may invalidate the result. The freeze option is useful when the octree file's integrity and loading speed is more important than its size, or when the octree is to be relocated to another directory, and is especially useful for creating library objects for the "instance" primitive type. If the input octree is frozen, the output will be also. The -w option suppresses warnings. A hyphen by itself ('-') tells oconv to read scene data from its standard input. This also implies the -f option. The only scene file changes that do not require octree regeneration are modifications to non-surface parameters. If the coordinates of a surface are changed, or any primitives are added or deleted, oconv must be run again. Programs will abort with a "stale octree" message if they detect any dangerous inconsistencies between the octree and the input files. Although the octree file format is binary, it is meant to be portable between machines. The only limitation is that machines with radi- cally different integer sizes will not work together. For the best results, the -f option should be used if an octree is to be used in different environments. DIAGNOSTICS
There are four basic error types reported by oconv: warning - a non-fatal input-related error fatal - an unrecoverable input-related error system - a system-related error internal - a fatal error related to program limitations consistency - a program-caused error Most errors are self-explanatory. However, the following internal errors should be mentioned: Too many scene files Reduce the number of scene files by combining them or using calls to xform(1) within files to create a hierarchy. Set overflow in addobject (id) This error occurs when too many surfaces are close together in a scene. Either too many surfaces are lying right on top of each other, or the bounding cube is inflated from an oversized object or an improper -b specification. If hundreds of triangles come together at a common vertex, it may not be possible to create an octree from the object. This happens most often when inane CAD systems create spheres using a polar tessellation. Chances are, the surface "id" is near one of those causing the problem. Hash table overflow in fullnode This error is caused by too many surfaces. If it is possible to create an octree for the scene at all, it will have to be done in stages using the -i option. EXAMPLE
To add book1, book2 and a transformed book3 to the octree ``scene.oct'': oconv -i scene.oct book1 book2 '!xform -rz 30 book3' > newscene.oct AUTHOR
Greg Ward NOTES
In the octree, the names of the scene files are stored rather than the scene information. This means that a new octree must be generated whenever the scene files are changed or moved. Also, an octree that has been moved to a new directory will not be able to find scene files with relative pathnames. The freeze option avoids these problems. make(1) or rad(1) can be used to automate octree creation and mainte- nance. SEE ALSO
getbbox(1), getinfo(1), make(1), obj2mesh(1), rad(1), rpict(1), rvu(1), rtrace(1), xform(1) RADIANCE
8/15/95 OCONV(1)
All times are GMT -4. The time now is 01:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy