Sponsored Content
Full Discussion: Extracting strings
Top Forums UNIX for Dummies Questions & Answers Extracting strings Post 76027 by hugow on Friday 24th of June 2005 05:58:42 AM
Old 06-24-2005
Extracting strings

Hi,

How do I extract the bytes size string from the ls -l command.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with extracting strings from a file

I want to collect the characters from 1-10 and 20-30 from each line of the file and take them in a file in the following format.Can someone help me with this : string1,string2 string1,string2 string1,string2 : : : : (7 Replies)
Discussion started by: cmsdelhi
7 Replies

2. Shell Programming and Scripting

Extracting the lines between 2 strings of a file

Hi, I have a sql file and i need to extract the table names used in the sql file using a unix script. If i can extract the lines between the keywords 'FROM' and 'WHERE' in the file, my job is done. can somebody tell me how to do this using a shell script. If u can just let me know, how to... (2 Replies)
Discussion started by: babloo
2 Replies

3. Shell Programming and Scripting

extracting numbers from strings

Hello all, I am being dumb with this and I know there is a simple solution. I have a file with the follwing lines bc stuff (more)...............123 bc stuffagain (moretoo)............0 bc stuffyetagain (morehere)......34 failed L3 thing..............1 failed this... (2 Replies)
Discussion started by: gobi
2 Replies

4. Shell Programming and Scripting

Extracting text between two strings, first instance only

There are a lot of ways to extract text from between two strings, but what if those strings occur multiple times and you only want the text from the first two strings? I can't seem to find anything to work here. I'm using sed to process the text after it's extracted, so I prefer a sed answer, but... (4 Replies)
Discussion started by: fubaya
4 Replies

5. Shell Programming and Scripting

Extracting the strings matching a pattern from a word

Hi All , I need to extract the strings that are matching with the pattern : CUST.<AnyStringOfAnyLength>.<AnyStringOfAnyLength> from a file and then write all these string into another file. e.g. If a file SOURCE contains following lines : IF(CUST.ABCD.EFGH==1) THEN CUST.ABCD.EFGH =... (7 Replies)
Discussion started by: swapnil.nawale
7 Replies

6. Shell Programming and Scripting

Extracting text between two strings

Hi, I've looked at a few existing posts on this, but they don't seem to work for my inputs. I have a text file where I want to extract all the text between two strings, every time that occurs. Eg my input file is Anna said that she would fetch the bucket. Anna and Ben moved the bucket.... (9 Replies)
Discussion started by: JamesForeman
9 Replies

7. Shell Programming and Scripting

Extracting strings from a log file.

I'm new to all this and I've been fiddling with this problem for HOURS and feel silly that I can't work it out! I have a .log file that VERY long and looks like this: 2011-08-31 10:03:34 SUESTART AG Amndmnt Client WebRequest DNU SUEEND Sequence: 600, 2011-08-31 10:03:34 SUESTART... (11 Replies)
Discussion started by: SusieSA
11 Replies

8. Shell Programming and Scripting

Extracting text between two constant strings

Hi All, I have a file whose common patter is like this: .I 1 .U 87049087 .S Some text here too .M This is a text .T Some another text here .P Name of the book .W Some lines of more text. This text needs to be extracted. .A more text goes here too .I 2 (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

9. UNIX for Beginners Questions & Answers

Extracting strings at various positions of text file

Hi Team - I hope everyone has been well! I export a file from one of our source systems that gives me more information than I need. The way the file outputs, I need to extract certain strings at different positions on the file and echo them to another file. I can do this in batch easily,... (2 Replies)
Discussion started by: SIMMS7400
2 Replies

10. Shell Programming and Scripting

Bash: extracting 2 strings from 1 line

Hi everyone. I am very new in bash scripting (and scripting at all). I've got lines like these: -rw-r--r-- 1 setub 1049089 27M mars 13 2017 arch_amiel_038g_f016r.tif -rw-r--r-- 1 setub 1049089 584K juin 9 2008 arch_amiel_composition.jpgI wish to extract 2 string types so that I can... (4 Replies)
Discussion started by: setub
4 Replies
GRAPHEME_EXTRACT(3)							 1						       GRAPHEME_EXTRACT(3)

grapheme_extract - Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8.

       Procedural style

SYNOPSIS
string grapheme_extract (string $haystack, int $size, [int $extract_type], [int $start], [int &$next]) DESCRIPTION
Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8. PARAMETERS
o $haystack - String to search. o $size - Maximum number items - based on the $extract_type - to return. o $extract_type - Defines the type of units referred to by the $size parameter: oGRAPHEME_EXTR_COUNT (default) - $size is the number of default grapheme clusters to extract. oGRAPHEME_EXTR_MAXBYTES - $size is the maximum number of bytes returned. oGRAPHEME_EXTR_MAXCHARS - $size is the maximum number of UTF-8 characters returned. o $start - Starting position in $haystack in bytes - if given, it must be zero or a positive value that is less than or equal to the length of $haystack in bytes. If $start does not point to the first byte of a UTF-8 character, the start position is moved to the next character boundary. o $next - Reference to a value that will be set to the next starting position. When the call returns, this may point to the first byte position past the end of the string. RETURN VALUES
A string starting at offset $start and ending on a default grapheme cluster boundary that conforms to the $size and $extract_type speci- fied. EXAMPLES
Example #1 grapheme_extract(3) example <?php $char_a_ring_nfd = "axCCx8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D" $char_o_diaeresis_nfd = "oxCCx88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D" print urlencode(grapheme_extract( $char_a_ring_nfd . $char_o_diaeresis_nfd, 1, GRAPHEME_EXTR_COUNT, 2)); ?> The above example will output: o%CC%88 SEE ALSO
grapheme_substr(3), Unicode Text Segmentation: Grapheme Cluster Boundaries . PHP Documentation Group GRAPHEME_EXTRACT(3)
All times are GMT -4. The time now is 02:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy