Sponsored Content
Top Forums Programming How to read specific lines in a bulk file using C file Programming Post 84849 by davidyang on Thursday 29th of September 2005 04:33:06 AM
Old 09-29-2005
you can use "cspilt" shell command to do that
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To Read a text file using shell Programming

Hello! I need to read a text file containing certains rows and columns!The following is a sample file with only three rows! 01:41:30:00:05:51 OFF 48506649K 5769415 63494357K 01:41:30:00:05:65 ON 4493546K 27266552 5880264K 01:41:30:00:05:78 OFF 614556K 89121 47291K... (1 Reply)
Discussion started by: sandytul
1 Replies

2. Shell Programming and Scripting

Shell Script to read specific lines in a file

I have a file with contents as follows Record 1: Rejected - Error on table "DWO"."P2G_CUST_EVENTS". ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated Record 5: Rejected - Error on table "DWO"."P2G_CUST_EVENTS". ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated Record 6:... (5 Replies)
Discussion started by: varshanswamy
5 Replies

3. Shell Programming and Scripting

Post Shell programming: Question about source a file and read data from the file

This is shell programming assignment. It needs to create a file called .std_dbrc contains STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB (which includes all my simple database files) and I am gonna use this .std_dbrc in my script file (read the data from the database files) like this: .... (3 Replies)
Discussion started by: ccwq
3 Replies

4. Shell Programming and Scripting

Read from file specific place in file using inode

Hello, I am using tcsh on AIX. I would like to write a script that does the following: 1. given an inode, how do I find exactly the name of the file? I know I could do this using ls -i | grep <inode> but it returns: <inode> <filename>. I need some string manipulation or something to... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

5. Shell Programming and Scripting

how read specific line in a file and write it in a new text file?

I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting? file1.html <head> <url>http://www.google.com</url> </head> file2.html <head>... (6 Replies)
Discussion started by: vel4ever
6 Replies

6. Shell Programming and Scripting

Read in specific lines in a file

I have a text file First title line name1 name2 name3 name4 (etc) other lines other lines other lines I want to read in this text file and parse the name1...name4 to a variable. How do I specificially read in these lines and these lines only? (10 Replies)
Discussion started by: piynik
10 Replies

7. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

8. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

9. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

10. Shell Programming and Scripting

Create a new file from another file with lines begins with a specific string

Hi, I have a file with below format myfile.txt aa aa1 aa2 qq aa4 ghs aa6 bbc gdf I m looking to create a file where lines begins with aa. myfile1.txt aa aa1 aa2 (4 Replies)
Discussion started by: Litu1988
4 Replies
Data::Stream::Bulk(3pm) 				User Contributed Perl Documentation				   Data::Stream::Bulk(3pm)

NAME
Data::Stream::Bulk - N at a time iteration API VERSION
version 0.11 SYNOPSIS
# get a bulk stream from somewere my $s = Data::Stream::Bulk::Foo->new( ... ); # can be used like this: until ( $s->is_done ) { foreach my $item ( $s->items ) { process($item); } } # or like this: while( my $block = $s->next ) { foreach my $item ( @$block ) { process($item); } } DESCRIPTION
This module tries to find middle ground between one at a time and all at once processing of data sets. The purpose of this module is to avoid the overhead of implementing an iterative api when this isn't necessary, without breaking forward compatibility in case that becomes necessary later on. The API optimizes for when a data set typically fits in memory and is returned as an array, but the consumer cannot assume that the data set is bounded. The API is destructive in order to minimize the chance that resultsets are leaked due to improper usage. API
Required Methods The API requires two methods to be implemented: is_done Should return true if the stream is exhausted. As long as this method returns a false value (not done) "next" could potentially return another block. next Returns the next block. Note that "next" is not guaranteed to return an array reference, even if "is_done" returned false prior to calling it. Convenience Methods items This method calls "next" and dereferences the result if there are pending items. all Force evaluation of the entire resultset. Note that for large data sets this might cause swap thrashing of various other undesired effects. Use with caution. cat @streams Concatenates this stream with @streams, returning a single stream. list_cat @tail Returns a possibly cleaned up list of streams. Used by "cat". Overridden by Data::Stream::Bulk::Array, Data::Stream::Bulk::Cat and Data::Stream::Bulk::Nil to implement some simple short circuiting. filter $filter Applies a per-block block filter to the stream. Returns a possibly new stream with the filtering layered. $filter is invoked once per block and should return an array reference to the filtered block. chunk $chunk_size Chunks the input stream so that each block returned by "next" will have at least $chunk_size items. loaded Should be overridden to return true if all the items are already realized (e.g. in the case of Data::Stream::Bulk::Array). Returns false by default. When true calling "all" is supposed to be safe (memory usage should be in the same order of magnitude as stream's own usage). This is typically useful when tranforming an array is easier than transorming a stream (e.g. optional duplicate filtering). CLASSES
Data::Stream::Bulk::Array This class is not a stream at all, but just one block. When the data set easily fits in memory this class can be used, while retaining forward compatibility with larger data sets. Data::Stream::Bulk::Callback Callback driven iteration. Data::Stream::Bulk::Chunked Wrapper to return larger blocks from an existing stream. Data::Stream::Bulk::DBI Bulk fetching of data from DBI statement handles. Data::Stream::Bulk::DBIC DBIx::Class::ResultSet iteration. Data::Stream::Bulk::FileHandle Iterates over lines in a text file. Data::Stream::Bulk::Nil An empty result set. Data::Stream::Bulk::Cat A concatenation of several streams. Data::Stream::Bulk::Filter A filter wrapping a stream. SEE ALSO
HOP::Stream, Iterator, Class::Iterator etc for one by one iteration DBI, DBIx::Class::ResultSet POE::Filter Data::Page Parallel::Iterator <http://en.wikipedia.org/wiki/MapReduce>, LISP, and all that other kool aid TODO
Sorted streams Add a hint for sorted streams (like "loaded" but as an attribute in the base role). Introduce a "merge" operation for merging of sorted streams. Optimize "unique" to make use of sorting hints for constant space uniquing. More utility functions To assist in proccessing and creating streams. Coercion tables Moose::Util::TypeConstraints VERSION CONTROL
This module is maintained using git. You can get the latest version from http://github.com/nothingmuch/data-stream-bulk/ <http://github.com/nothingmuch/data-stream-bulk/>. AUTHOR
Yuval Kogman <nothingmuch@woobling.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Yuval Kogman. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-02-14 Data::Stream::Bulk(3pm)
All times are GMT -4. The time now is 12:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy