Hi,
I have a file named "Test_2008_01_21"
The file contains a string "manual" that occurs many times in the file
How can i find the positions of the string "manual" in the file
Ex: if the string " manual " occurs three times in the file. i want to replace the second occurance of string... (6 Replies)
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found..The issue is the last... (15 Replies)
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
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)
Hi,
i have a text file as :
abc 0 1 Pass
hjk 1 1 Pass
bhk 0 0 Fail
jjh 8 2 Pass
nkji 0 1 Pass
Now I want to check that if 1st column is jjh , then , store the value of 3rd string of that line in a variable. Hence, 2... (8 Replies)
Hi,
I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 Replies)
I am trying to replace the string in position 26 through 35 of the data file with 10 spaces and I want the remaining file to stay as is, the record length is over 900 characters? I am trying to use the AWK and substr but I am not getting it formatted correctly.
Before... (6 Replies)
I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this.
string(Scenario 1)- user::r--,user::ourfrd:r--
String(Scenario 2)- user::r--
File
****
# file: /local/Desktop/myfile
# owner: me
# group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
LEARN ABOUT FREEBSD
strings
STRINGS(1) BSD General Commands Manual STRINGS(1)NAME
strings -- print the strings of printable characters in files
SYNOPSIS
strings [-a | --all] [-e encoding | --encoding=encoding] [-f | --print-file-name] [-h | --help] [-n number | --bytes=number | -number] [-o]
[-t radix | --radix=radix] [-v | --version] [file ...]
DESCRIPTION
For each file specified, the strings utility prints contiguous sequences of printable characters that are at least n characters long and are
followed by an unprintable character. The default value of n is 4. By default, the strings utility only scans the initialized and loaded
sections of ELF objects; for other file types, the entire file is scanned. The strings utility is mainly used for determining the contents
of non-text files.
If no file name is specified as an argument, standard input is read.
The following options are available:
-a | --all
For ELF objects, scan the entire file for printable strings.
-e encoding | --encoding=encoding
Select the character encoding to be used while searching for strings. Valid values for argument encoding are:
s for single 7-bit-byte characters (ASCII, ISO 8859).
S for single 8-bit-byte characters.
l for 16-bit little-endian.
b for 16-bit big-endian.
L for 32-bit little-endian.
B for 32-bit big-endian.
The default is to assume that characters are encoded using a single 7-bit byte.
-f | --print-file-name
Print the name of the file before each string.
-h | --help
Print a usage summary and exit.
-n number | --bytes=number | -number
Print the contiguous character sequence of at least number characters long, instead of the default of 4 characters.
-o Equivalent to specifying -t o.
-t radix | --radix=radix
Print the offset from the start of the file before each string using the specified radix. Valid values for argument radix are:
d for decimal
o for octal
x for hexadecimal
-v | --version
Display a version identifier and exit.
EXIT STATUS
The strings utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
To display strings in /bin/ls use:
$ strings /bin/ls
To display strings in all sections of /bin/ln use:
$ strings -a /bin/ln
To display strings in all sections of /bin/cat prefixed with the filename and the offset within the file use:
$ strings -a -f -t x /bin/cat
SEE ALSO ar(1), nm(1), objdump(1), ranlib, readelf(1), size(1)HISTORY
The first FreeBSD strings utility appeared in FreeBSD v3. It was later discontinued in FreeBSD v5, when i386-only a.out format was dropped in
favor of ELF.
AUTHORS
The strings utility was re-written by S.Sam Arun Raj <samarunraj@gmail.com>. This manual page was written by S.Sam Arun Raj
<samarunraj@gmail.com>.
BSD December 19, 2011 BSD