05-08-2010
Search complicated strings on file
Can someone help me? I been figuring out how I can search and extract a complicated search string from a file. The whole string is delimited by a period. And the file where I'm searching is composed of differnt string such as that. For example, I have this search string:
Quote:
sim.lim.13_60.colorValidationResponse
and I have a file containing:
Quote:
acm.omg.19_10.figureRetrieveAnswer
mai.lim.13_60.colorValidationResponse
hmo.bimx.10_10.staffInformationFile
sim.nam.13_60.colorValidationResponse
sim.lim.12_80.colorValidationResponse
sim.lim.13_60.colorValidationRequest
sim.lim.14_90.colorValidationResponse
sim.nam.13_60.colorValidationResponse
Now I need four outputs since my search string is divided into four strings delimited by period:
Quote:
1st Output:
mai.lim.13_60.colorValidationResponse
2nd Output:
sim.nam.13_60.colorValidationResponse
sim.nam.13_60.colorValidationResponse
3rd Output:
sim.lim.12_80.colorValidationResponse
sim.lim.14_90.colorValidationResponse
4th Output:
sim.lim.13_60.colorValidationRequest
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi experts,
I have the file with these lines:
var1=thu_13:12:32,var2=Microsoft,var3=240ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53
var1=thu_13:13:32,var2=Microsoft,var3=213ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53... (9 Replies)
Discussion started by: lalelle
9 Replies
2. Shell Programming and Scripting
Hi All,
I want to search all the ksh scripts that has following details.
1. Search for "exit 0"
2. Search for "sqlldr" or sqlplus"
3. In the above files i want to search for all the script that has no "case" in it.
Please advice.
Thanks,
Deep (2 Replies)
Discussion started by: deepakpv
2 Replies
3. Shell Programming and Scripting
Hi,
I have following problem. I have a file with time stamps and some data describing what happened between time stamps. Something like this:
10:00
meeting with K
meeting with L
11:00
lunch
12:00
work with K
13:00
From this file I have to get a file with... (7 Replies)
Discussion started by: mmike
7 Replies
4. Shell Programming and Scripting
I need to extract the last block of /== START OF SQLPLUS ==/ and /== END OF SQLPLUS ==/. The logifle is written to several times in a day using >> to append. I need a solution using grep/sed.
logfile looks like this
START OF LOGFILE
/== START OF SQLPLUS ==/
ERROR
/== END OF SQLPLUS... (5 Replies)
Discussion started by: hanton
5 Replies
5. Emergency UNIX and Linux Support
Hi All,
I'm trying to extract all the description fields from a MIB file which contain multiple instances of the following text:
ENTERPRISE compaq
VARIABLES { sysName, cpqHoTrapFlags, cpqSsBoxCntlrHwLocation,
cpqSsBoxCntlrIndex, cpqSsBoxBusIndex,... (10 Replies)
Discussion started by: badoshi
10 Replies
6. Shell Programming and Scripting
I have a text file for which i need a script which does some fancy search and replace.
Basically i want to loop through each line, if i find an occurance of certain string format then i want to carry on search on replace another line, once i replaced this line i will contine to search for the... (7 Replies)
Discussion started by: kelseyh
7 Replies
7. Shell Programming and Scripting
Hi
I want to search multiple strings in a file . But the search should start with "From" Keyword and end with before "Where" keyword.
Please suggest me.
Thanks (2 Replies)
Discussion started by: sboss
2 Replies
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
I have a file search_strings.txt filled with search strings which have a blank in between and look like this:
S. g. Erh.
o. J.
v. d. Chijs
g. Ehr.I would like to search the strings in the second given Textfile.txt and it shall return the column number.
Can anybody help with the correct... (3 Replies)
Discussion started by: sdf
3 Replies
10. Shell Programming and Scripting
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Discussion started by: An0mander
2 Replies
SIM(5) File Formats Manual SIM(5)
NAME
sim - format of .sim files read by esim, crystal, etc.
DESCRIPTION
The simulation tools crystal(1) and esim(1) accept a circuit description in .sim format. There is a single .sim file for the entire cir-
cuit, unlike Magic's ext(5) format in which there is a .ext file for every cell in a hierarchical design.
A .sim file consists of a series of lines, each of which begins with a key letter. The key letter beginning a line determines how the
remainder of the line is interpreted. The following are the list of key letters understood.
| units: s tech: tech format: MIT|LBL|SU
If present, this must be the first line in the .sim file. It identifies the technology of this circuit as tech and gives a scale
factor for units of linear dimension as s. All linear dimensions appearing in the .sim file are multiplied by s to give centimi-
crons. The format field signifies the sim variant. MIT and SU are compatible and understood by all tools. LBL is understood only by
gemini(1).
type g s d l w x y g=gattrs s=sattrs d=dattrs
Defines a transistor of type type. Currently, type may be e or d for NMOS, or p or n for CMOS. The name of the node to which the
gate, source, and drain of the transistor are connected are given by g, s, and d respectively. The length and width of the transis-
tor are l and w. The next two tokens, x and y, are optional. If present, they give the location of a point inside the gate region
of the transistor. The last three tokens are the attribute lists for the transistor gate, source, and drain. If no attributes are
present for a particular terminal, the corresponding attribute list may be absent (i.e, there may be no g= field at all). The
attribute lists gattrs, etc. are comma-separated lists of labels. The label names should not include any spaces, although some
tools can accept label names with spaces if they are enclosed in double quotes. In version 6.4.5 and later the default format pro-
duced by ext2sim is SU. In this format the attribute of the gate starting with S_ is the substrate node of the fet. The attributes
of the gate, and source and substrate starting with A_, P_ are the area and perimeter (summed for that node only once) of the source
and drain respectively. This addition to the format is backwards compatible.
C n1 n2 cap
Defines a capacitor between nodes n1 and n2. The value of the capacitor is cap femtofarads. NOTE: since many analysis tools com-
pute transistor gate capacitance themselves from the transistor's area and perimeter, the capacitance between a node and substrate
(GND!) normally does not include the capacitance from transistor gates connected to that node. If the .sim file was produced by
ext2sim(1), check the technology file that was used to produce the original .ext files to see whether transistor gate capacitance is
included or excluded; see ``Magic Maintainer's Manual #2: The Technology File'' for details.
R node res
Defines the lumped resistance of node node to be res ohms. This construct is only interpreted by a few programs.
r node1 node2 res
Defines an explicit resistor between nodes node1 and node2 of resistance res ohms. This construct is only interpreted by a few pro-
grams.
N node darea dperim parea pperim marea mperim
As an alternative to computed capacitances, some tools expect the total perimeter and area of the polysilicon, diffusion, and metal
in each node to be reported in the .sim file. The N construct associates diffusion area darea (in square centimicrons) and diffu-
sion perimeter dperim (in centimicrons) with node node, polysilicon area parea and perimeter pperim, and metal area marea and
perimeter mperim. This construct is technology dependent and obsolete.
A node attr
Associates attribute attr for node node. The string attr should contain no blanks.
= node1 node2
Each node in a .sim file is named implicitly by having it appear in a transistor definition. All node names appearing in a .sim
file are assumed to be distinct. Some tools, such as esim(1), recognize aliases for node names. The = construct allows the name
node2 to be defined as an alias for the name node1. Aliases defined by means of this construct may not appear anywhere else in the
.sim file.
SEE ALSO
crystal(1), esim(1), ext2sim(1), sim2spice(1), ext(5)
4th Berkeley Distribution SIM(5)