Depending upon the occurence of string 'xyz', I want to remove -t from the input file.
There is not a fixed length input file.
Any suggestions
Input file:
this is xyz line -t of the data
this is line 2 of -t of the data
xyz this is line 3 of -t the file
this is line xyz of the -t file... (1 Reply)
I need a script for...
how to find a position of column data and print some string in the next line and same position
position should find based on *HEADER8* in text
for ex: ord123 abs 123 987HEADER89 test234
ord124 abc 124 987HEADER88 test235
... (1 Reply)
Hi All
I have a rather unusual problem, which i have not faced till now. I have a script which exports some paths to a text file. The script runs fine but when i check the output file i can see some junk characters ^M appended at end of lines and random places. I am not able to figure... (4 Replies)
Hello everyone this is my first post of many to come :)
I am writing a script and in this script at one point i need to replace a character in a particular position in a string for example:
in the string "mystery" i would need to replace the 3rd position to an "r" so the string becomes... (3 Replies)
Suppose there are two files:
A, format is like:
line1 12
line2 33
line3 6
...
B, format is like:
>header
taaccctaaccctaaccctaacccaaccccaccccaaccccaaccccaac
ccaaccctaaccctaaccctaacccaaccctaaccctaaccctaacccaa
ccctcaccctcaccctcaccctcaccctcaccctcaccctcaccctaacc... (1 Reply)
Hi,
i want find the character '-' in a file from position 284-298, if it occurs i need to replace it with 'O ' for the position in the file. How to do that using SED command.
thanks in advance,
Sara (9 Replies)
i have this prob
I have some records in a file1 like this
1001 sajal singh tampa
1002 .... so on
i have a pattern file which is like this
1,4 4,13 14,15
i have to read the first pair 1,4 and extract that from the first record
so the pattern is 1001
now i have to scramble 1001... (1 Reply)
Hi guyz i want to know nth position of character in string. For ex.
var="UK,TK,HK,IND,AUS"
now if we see 1st occurance of , is at 3 position, 2nd at 6,..4th at 13 position.
1st position we can find through INDEX, but what about 2nd,3rd and 4th or may be upto nth position. ?
In oracle we had... (2 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)
Discussion started by: Pradhikshan
9 Replies
LEARN ABOUT PHP
mb_strrpos
MB_STRRPOS(3) 1 MB_STRRPOS(3)mb_strrpos - Find position of last occurrence of a string in a stringSYNOPSIS
int mb_strrpos (string $haystack, string $needle, [int $offset], [string $encoding = mb_internal_encoding()])
DESCRIPTION
Performs a multibyte safe strrpos(3) operation based on the number of characters. $needle position is counted from the beginning of
$haystack. First character's position is 0. Second character position is 1.
PARAMETERS
o $haystack
- The string being checked, for the last occurrence of $needle
o $needle
- The string to find in $haystack.
o $offset
- May be specified to begin searching an arbitrary number of characters into the string. Negative values will stop searching at an
arbitrary point prior to the end of the string.
o $encoding
-The $encoding parameter is the character encoding. If it is omitted, the internal character encoding value will be used.
RETURN VALUES
Returns the numeric position of the last occurrence of $needle in the $haystack string. If $needle is not found, it returns FALSE.
CHANGELOG
+--------+---------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------+
| 5.2.0 | |
| | |
| | Added the optional parameter $offset. |
| | |
+--------+---------------------------------------+
NOTES
Note
The $encoding parameter was moved from the third position to the fourth in PHP 5.2.0. For backward compatibility, $encoding can be
specified as the third parameter, but doing so is deprecated and will be removed in the future.
SEE ALSO mb_strpos(3), mb_internal_encoding(3), strrpos(3).
PHP Documentation Group MB_STRRPOS(3)