Hi,
I want to print only lines in between two strings and not the strings using awk.
Eg:
OUTPUT
top 2
bottom 1
left 0
right 0
page 66
END
I want to print into a new file only
top 2
bottom 1
left 0... (4 Replies)
Hi All,
I have a file in which i want to print all the lines between 2 defined strings. Ex- I have file with data as follows
STEP1:-
----- has some 20 -30 lines of data
STEP2:-
----- has some 20 -30 lines of data
So i want to print those lines between STEP1 & STEP2. (line including STEP1)... (7 Replies)
hi all! i have a file like this
lea 25 female
dave 18 male
jake 27 male
and i want to have an output file like this
my name is lea. i am 25. female
my name is dave. i am 18. male
my name is jake. i am 27. male
thanks! (2 Replies)
I have one script which gave final output as the below statment.
Successfully added Nomination Petition Manifest to the Content Manager.
Now i want a sed statement which will search for this statement in any given file and print only Nomination Petition Manifest. I don't want to hardcore... (13 Replies)
Hi,
Here is an example:
I have a grep line:
grep -i -r -H "$WORD" "$DIRECTORY"with an output like this:
/media/dir/dir2//dir4/file.txt:/media/dir/dir2/dir3/file_16072008/es6.txt: "content of the file found from grep"/media/dir/dir2/dir3/dir4/file3.txt:/media/dir/dir2/dir3//file.txt:"other... (3 Replies)
I have a text file contains
*02638650* SAMBO
1 Spouse SAMBO FELIX
*01591453* MADUAGUGBUO
4 Child3 MADUAGUGBUO JOY
*01488523* ANYIAM
1 Spouse ANYIAM FRANCA
2 Child1 ANYIAM GRACE
*01647769* EGWUTUOHA
0 Principal ... (6 Replies)
hey,
i m having a hard time trying to print only the first occurrence between 2 idenicale strings.
for the following output:
please
help
me im a
noob
please
im a noob
help me
noob
please
help
me im a
noob
please
im a noob
help me
noob (3 Replies)
Discussion started by: boaz733
3 Replies
LEARN ABOUT ULTRIX
xstr
xstr(1) General Commands Manual xstr(1)Name
xstr - extract strings from C program
Syntax
xstr [-c] [-] [file]
Description
The command maintains a file strings into which strings in component parts of a large program are hashed. These strings are replaced with
references to this common area. This serves to implement shared constant strings, most useful if they are also read-only.
The command
xstr -c name
will extract the strings from the C source in name, replacing string references by expressions of the form (&xstr[number]) for some number.
An appropriate declaration of is prepended to the file. The resulting C text is placed in the file x.c, to then be compiled. The strings
from this file are placed in the strings data base if they are not there already. Repeated strings and strings which are suffices of
existing strings do not cause changes to the data base.
After all components of a large program have been compiled a file xs.c declaring the common space can be created by a command of the form
xstr
This xs.c file should then be compiled and loaded with the rest of the program. If possible, the array can be made read-only (shared) sav-
ing space and swap overhead.
The command can also be used on a single file. A command
xstr name
creates files x.c and xs.c as before, without using or affecting any strings file in the same directory.
It may be useful to run after the C preprocessor if any macro definitions yield strings or if there is conditional code which contains
strings which may not, in fact, be needed. The command reads from its standard input when the argument `-' is given. An appropriate com-
mand sequence for running after the C preprocessor is:
cc -E name.c | xstr -c -
cc -c x.c
mv x.o name.o
The command does not touch the file strings unless new items are added, thus can avoid remaking xs.o unless truly necessary.
Options
- Reads stdin.
-c Extracts strings from specified C source (next argument).
Restrictions
If a string is a suffix of another string in the data base, but the shorter string is seen first by both strings will be placed in the data
base, when just placing the longer one there will do.
Files
strings Data base of strings
x.c Massaged C source
xs.c C source for definition of array `xstr'
/tmp/xs* Temp file when `xstr name' doesn't touch strings
See Alsomkstr(1)xstr(1)