I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (1 Reply)
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (2 Replies)
Hi Guys,
I need to check whether the last column is RP, If so, then i have to second column and pass it to a select statement as sonid and fetch the value to a variable and run it. This has to be done till the last column is RW.
value Fatherid sonid topid ... (8 Replies)
I am trying to read a file in a shl script (only one record) and stored in a variable file_number
I got the following
read -u $BANNER_HOME/xxxxxxx/misc/EFTSQL.dat file_number
file_number2 = $file_number + 1
echo $file_number2 > $BANNER_HOME/xxxxxx/misc/EFTSQL.dat
EOF
It is not working... (2 Replies)
Reposting since I didnt not get any reply.
I have a problem while filtering records from a file. Can somebody help please?
For eg: Consider the below files
Record file:
0003@00000000000190@20100401@201004012010040120100401@003@... (1 Reply)
How do I filter only comments and still keep Line breaks at the end of the line!?
This is one of the common tasks we all do,, How can we do this in a right way..!?
I try to ignore empty lines and commented lines using following approach.
test.sh
# \040 --> SPACE character octal... (17 Replies)
Hi Folks,
I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file.
bash scripting is what i need.
Data.txt
Name OrderID Quantity
Sam 123 300
Jay 342 498
Kev 78 2500
Sam 420 50
Vic 10... (3 Replies)
Hi Experts,
I have csv file with 30, 40 columns
Pasting just 2 column for problem description.
Need to print error if below combination is not present in file
check for column-1 (DocumentNumber) and filter columns where value in DocumentNumber field is same.
For all such rows, the field... (7 Replies)
Discussion started by: as7951
7 Replies
LEARN ABOUT PHP
stream_filter_prepend
STREAM_FILTER_PREPEND(3) 1 STREAM_FILTER_PREPEND(3)stream_filter_prepend - Attach a filter to a streamSYNOPSIS
resource stream_filter_prepend (resource $stream, string $filtername, [int $read_write], [mixed $params])
DESCRIPTION
Adds $filtername to the list of filters attached to $stream.
PARAMETERS
o $stream
- The target stream.
o $filtername
- The filter name.
o $read_write
- By default, stream_filter_prepend(3) will attach the filter to the read filter chain if the file was opened for reading (i.e.
File Mode: r, and/or +). The filter will also be attached to the write filter chain if the file was opened for writing (i.e. File
Mode: w, a, and/or +). STREAM_FILTER_READ, STREAM_FILTER_WRITE, and/or STREAM_FILTER_ALL can also be passed to the $read_write
parameter to override this behavior. See stream_filter_append(3) for an example of using this parameter.
o $params
- This filter will be added with the specified $params to the beginning of the list and will therefore be called first during
stream operations. To add a filter to the end of the list, use stream_filter_append(3).
RETURN VALUES
Returns a resource which can be used to refer to this filter instance during a call to stream_filter_remove(3).
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.1.0 | |
| | |
| | Prior to PHP 5.1.0, this function returns TRUE |
| | on success or FALSE on failure. |
| | |
+--------+---------------------------------------------------+
NOTES
Note
When using custom (user) filters
stream_filter_register(3) must be called first in order to register the desired user filter to $filtername.
Note
Stream data is read from resources (both local and remote) in chunks, with any unconsumed data kept in internal buffers. When a new
filter is prepended to a stream, data in the internal buffers, which has already been processed through other filters will not be
reprocessed through the new filter at that time. This differs from the behavior of stream_filter_append(3).
Note
When a filter is added for read and write, two instances of the filter are created. stream_filter_prepend(3) must be called twice
with STREAM_FILTER_READ and STREAM_FILTER_WRITE to get both filter resources.
SEE ALSO stream_filter_register(3), stream_filter_append(3).
PHP Documentation Group STREAM_FILTER_PREPEND(3)