Hi,
I have several files with data that have to be imported to a database. These files contain records with separator characters. Some records are corrupt (2 separators are missing) and I need to correct them prior to importing them into the db.
Example:
... (5 Replies)
Hello UNIX experts,
I have 124 text files in a directory. I want to extract the 45678th line of all the files sequentialy by file names. The extracted lines should be printed in the output file on seperate lines.
e.g. The input Files are one.txt, two.txt, three.txt, four.txt
The cat of four... (1 Reply)
Hello Folks..
I need your help ..
here the example of my problem..i know its easy..i don't all the commands in unix to do this especiallly sed...here my string..
dwc2_dfg_ajja_dfhhj_vw_dec2_dfgh_dwq
desired output is..
dwc2_dfg_ajja_dfhhj
it's a simple task with tail... (5 Replies)
Hi
I have requirement to find nth occurrence in a file and capture data from with in lines (between lines)
Data in File.
<QUOTE>
<SESSION>
<ATTRIBUTE NAME='Parameter Filename' VALUE='file1.parm'/>
<ATTRIBUTE NAME='Service Name' VALUE='None'/>
</SESSION>
<SESSION>
<ATTRIBUTE... (6 Replies)
There is already one thread with the same heading. But here the case is little different.
i have a line which have a field separator '|'
abc|def|ghi|jkl|mno|pqr|stu|vwx|yz
I want to replace every 3rd occurance + next character with the same + newline character.. I mean i want to enter a... (6 Replies)
Hi all,
Here is my problem for which i am breaking my head for past three days..
I have parted command output as follows..
Model: ATA WDC WD5000AAKS-0 (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type ... (3 Replies)
Hi,
I am getting crazy after days on looking at it:
Bash in Ubuntu 12.04.1
I want to do this:
pattern="system /path1/file1 file1"
new_pattern=" data /path2/file2 file2"
file to edit: data.db
- I need to search in the file data.db for the nth occurrence of pattern
- pattern must... (14 Replies)
Please can someone help with this?
I have a file with lines as follows:
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
When I use the... (7 Replies)
Hi,
I would like to know how, using sed, be able to insert contents of file2 in file1 after say the second occurrence of a given string? e.g.
> cat file1
banana
apple
orange
apple
banana
pear
tangerine
apple
> cat file2
I don't like apples
What would be the sed command to insert... (5 Replies)
Hello,
Below command trims right after the nth occurrence of a string.
When I try in while loop, it is not working.
In Terminal
IFS=/ ; read -ra val < Textfile ; echo "${val:0:3}"
It gives only one line:
sunday/monday/tuesday
Textfile:
sunday/monday/tuesday/wednesday/thursday... (2 Replies)
Discussion started by: baris35
2 Replies
LEARN ABOUT PHP
mb_strpos
MB_STRPOS(3) 1 MB_STRPOS(3)mb_strpos - Find position of first occurrence of string in a stringSYNOPSIS
int mb_strpos (string $haystack, string $needle, [int $offset], [string $encoding = mb_internal_encoding()])
DESCRIPTION
Finds position of the first occurrence of a string in a string.
Performs a multi-byte safe strpos(3) operation based on number of characters. The first character's position is 0, the second character
position is 1, and so on.
PARAMETERS
o $haystack
- The string being checked.
o $needle
- The string to find in $haystack. In contrast with strpos(3), numeric values are not applied as the ordinal value of a character.
o $offset
- The search offset. If it is not specified, 0 is used.
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 first occurrence of $needle in the $haystack string. If $needle is not found, it returns FALSE.
SEE ALSO mb_internal_encoding(3), strpos(3).
PHP Documentation Group MB_STRPOS(3)