Hi,
I have many files scattered in all different folders. I want to replace the text within all the files using a single command ( awk, sed...) Is it possible?
example
find all the files in which there is text "memory" and replace it with "branded_memories".
the files can be at the... (2 Replies)
Hi,
I will use below command for grep single string ("osuser" is search string)
ex: find . -type f | xarg grep -il osuser
but i have one more string "v$session"
here i want to grep in which file these two strings are present.
any help is appreciated,
Thanks in advance.
Gagan (2 Replies)
Hi,
I am trying to get lines between the last occurrences of two patterns. I have files that have several occurrences of “Standard” and “Visual”. I will like to get the lines between “Standard” and “Visual” but I only want to retain only the last one e.g.
Standard
Some words
Some words
Some... (4 Replies)
Hello,
I can extract lines in a file, between two strings but only one time.
If there are multiple occurencies, my command show only one block.
Example, monfichier.txt contains :
debut_sect
texte L1
texte L2
texte L3
texte L4
fin_sect
donnees inutiles 1
donnees inutiles 2
... (8 Replies)
I have a list of files all over a file system e.g.
/home/1/foo/bar.x
/www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g.
if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc.
There... (2 Replies)
Hi, every one!
I have a file with multiple strings.
file1
ATQRGNE
ASQGVKFTE
ASSQYRDRGGLET
SPEQGARSDE
ASSRDFTDT
ASSYSGGYE
ASSYTRLWNTGE
ASQGHNTD
PSLGGGNQPQH
SLDRDSYNEQF
I want to grep each string in hundreds of files in the same directory, further, I want to find out the string... (7 Replies)
Hello all,
I have since given up trying to figure this out and used sed instead, but I am trying to understand awk and was wondering how someone might do this in awk.
I am trying to match on the first field of a specific file with the first field on multiple files, and append the second field... (2 Replies)
Hi All,
I want to use egrep on multiple files and the results should be output to multiple files. I am using the below code in my shell script(working in Ksh shell). However with this code I am not attaining the desired results.
#!/bin/ksh
(
a="/path/file1"
b="path/file2"
for file in... (4 Replies)
I have 4000 files like
$cat clus_grp_seq10_g.phy
18 1002
anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG
aver_OOF92921_1 ... (1 Reply)
Im having an issue when trying to replace the first column with a new set of values in multiple files. The results from the following code only replaces the files with the last set of values in val.txt. I want to replace all the files with all the values.
for date in {1..31}
do
for val in... (1 Reply)
Discussion started by: ncwxpanther
1 Replies
LEARN ABOUT OSF1
xstr
xstr(1) General Commands Manual xstr(1)NAME
xstr - Extracts strings from C programs to implement shared strings
SYNOPSIS
xstr [-c] [file | -]
The xstr command maintains a file called strings into which strings in component parts of a large program are hashed.
OPTIONS
Extracts strings from the specified file.
DESCRIPTION
The strings extracted by xstr are replaced with references to this array. This serves to implement shared constant strings, most useful if
they are also read-only.
The following command extracts the strings from the C source in file, replacing string references by expressions of the form (&xstr[num-
ber]) for some number. xstr -c file
The xstr command uses file as input; the resulting C text is placed in the file x.c to then be compiled. The strings from this file are
appended to the strings file if they are not there already. Repeated strings and strings that are suffixes of existing strings do not cause
changes to the file.
If a string is a suffix of another string in the file, but the shorter string is seen first by xstr, both strings are placed in the file
strings.
After all components of a large program are compiled, a file xs.c declaring the common xstr space can be created by a command of the fol-
lowing form: xstr
Compile and load this xs.c file with the rest of the program. Some C compilers may, by default, put strings in a read-only text section.
The xstr command can also be used on a single file. The following command creates files x.c and xs.c as before, without using or affecting
a strings file in the same directory. xstr file
It may be useful to run xstr after the C preprocessor if any macro definitions yield strings or if there is conditional code that contains
strings that may not be needed. The xstr command reads from its standard input when the argument - (dash) is given. An appropriate command
sequence for running xstr after the C preprocessor is as follows: cc -E file.c | xstr -c - cc -c x.c mv x.o file.o
The xstr command does not touch the file strings unless new items are added, thus make can avoid remaking xs.o unless truly necessary.
EXAMPLES
To extract the strings from the C source in the file.c parameter, replacing string references by expressions of the form (&xstr[number]),
enter: xstr -c file
An appropriate declaration of the xstr array is prepended to file. The resulting C text is placed in the file x.c, to then be com-
piled. To declare the common xstr array space in the xs.c file, enter: xstr
FILES
File that contains the extracted strings. Modified C source. C source for definition of array xstr. Temporary file when the xstr command
does not touch strings.
SEE ALSO
Commands: mkstr(1)xstr(1)