Sponsored Content
Full Discussion: SED to extract characters
Top Forums Shell Programming and Scripting SED to extract characters Post 302130145 by lorcan on Friday 3rd of August 2007 07:22:36 AM
Old 08-03-2007
Dont post duplicate thread and please write in detail about your req.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep and extract the characters after

Hi All, I have lines like below in a file A /u/ab/test1.dat A/u/ab/test2.dat A /u/bb/test3.dat A/u/cc/test4.dat I will need /u/ab/test1.dat /u/ab/test2.dat /u/bb/test3.dat /u/cc/test4.dat Pls help Thanks (6 Replies)
Discussion started by: thumsup9
6 Replies

2. Shell Programming and Scripting

SED to extract characters

Hi, Please let me know how do we write a piece of code to extract characters from a line using SED. (2 Replies)
Discussion started by: Shilpi
2 Replies

3. Shell Programming and Scripting

Extract string between two different characters

I want to extract a string from a line in a text file between two different characters: for example: :string" I want to extract string. It has to be done in a one-liner. (11 Replies)
Discussion started by: rein
11 Replies

4. Shell Programming and Scripting

Extract some characters with SED or AWK

Hi, I have the following example string: today_is_a_good_day.txt The character "_" inside the string can sometimes be more or less. The solution for every string equal the count of "_" should be alway the rest after the last underline character. Result: day.txt I want to use awk... (5 Replies)
Discussion started by: climber
5 Replies

5. UNIX for Dummies Questions & Answers

extract characters from a variable

Hi All, I have scenario as below, I want to cut the characters and store it variable2.. and want to display the variable2.. as shown below... eg: the size may differs , i am show just an example..... numbers are not fixed in variable1..i want to extract characters and... (1 Reply)
Discussion started by: G.K.K
1 Replies

6. Shell Programming and Scripting

TO Extract Last 10 Characters from a line

Hi Guys!!!!!!!!!!! How do we extract last 13 characters from a line I/p: .R1/new/sv902a.01.per O/p: sv902a.01.per And the no of characters differs in each line.. Kindly help me out in this!!!!!!!!!!! Thanks in Advance (4 Replies)
Discussion started by: aajan
4 Replies

7. Shell Programming and Scripting

Extract data between two characters

Hi, how can i extract a data between two characters input file is abc efg hig - 99.4% (16337276 kB) used efg klm - 47.1% (7734968 kB) used hij - 99.4% (16341464 kB) used klm -93.7% (15394516 kB) used output should be 99.4 (5 Replies)
Discussion started by: jobycxa
5 Replies

8. Shell Programming and Scripting

extract last 8 characters from a file name

Dear gurus I have several files with the following format filenameCCYYMMDD , that is the last 8 characters will be the date in CCYYMMDD format. eg FILENAME20110523 . Could anyone please put me through on how to extract only the last 8 characters from the files. I am thinking of using awk,sed... (2 Replies)
Discussion started by: erinlomo
2 Replies

9. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies

10. Shell Programming and Scripting

Outputting characters after a given string and reporting the characters in the row below --sed

I have this fastq file: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGGGGGGGGGGGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCA +test-1 GGGGGGGGGGGGGGGGGCCGGGGGFF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8... (10 Replies)
Discussion started by: Xterra
10 Replies
EIO_GRP_ADD(3)								 1							    EIO_GRP_ADD(3)

eio_grp_add - Adds a request to the request group.

SYNOPSIS
void eio_grp_add (resource $grp, resource $req) DESCRIPTION
eio_grp_add(3) adds a request to the request group. PARAMETERS
o $grp - The request group resource returned by eio_grp(3) o $req - The request resource RETURN VALUES
eio_grp_add(3) doesn't return a value. EXAMPLES
Example #1 Grouping requests <?php /* * Create a group request to open, read and close a file */ // Create temporary file and write some bytes to it $temp_filename = dirname(__FILE__) ."/eio-file.tmp"; $fp = fopen($temp_filename, "w"); fwrite($fp, "some data"); fclose($fp); /* Is called when the group requests are done */ function my_grp_done($data, $result) { var_dump($result == 0); @unlink($data); } /* Is called when eio_open() done */ function my_grp_file_opened_callback($data, $result) { global $grp; // $result should contain the file descriptor var_dump($result > 0); // Create eio_read() request and add it to the group // Pass file descriptor to the callback $req = eio_read($result, 4, 0, EIO_PRI_DEFAULT, "my_grp_file_read_callback", $result); eio_grp_add($grp, $req); } /* Is called when eio_read() done */ function my_grp_file_read_callback($data, $result) { global $grp; // Read bytes var_dump($result); // Create eio_close() request and add it to the group // $data should contain the file descriptor $req = eio_close($data); eio_grp_add($grp, $req); } // Create request group $grp = eio_grp("my_grp_done", $temp_filename); var_dump($grp); // Create eio_open() request and add it to the group $req = eio_open($temp_filename, EIO_O_RDWR | EIO_O_APPEND , NULL, EIO_PRI_DEFAULT, "my_grp_file_opened_callback", NULL); eio_grp_add($grp, $req); // Process requests eio_event_loop(); ?> The above example will output something similar to: resource(6) of type (EIO Group Descriptor) bool(true) string(4) "some" bool(true) SEE ALSO eio_grp, eio_grp_cancel, eio_grp_limit. PHP Documentation Group EIO_GRP_ADD(3)
All times are GMT -4. The time now is 06:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy