Sponsored Content
Top Forums Shell Programming and Scripting Extract a specific line from a stream Post 302486424 by Oddant on Saturday 8th of January 2011 12:28:17 PM
Old 01-08-2011
Nope sorry that doesn't seem to work or perhaps i'm doing it the wrong way.
does it not already exist a unix command ?

ok i've found the line function but this function seems to return the first line of any stream.
Besides maybe i'm using it badly.

anyway thanks for your help, but when I type "f <(ls -1) 2" nothing happening, is that working on your system?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract the lines between specific line number from a text file

Hi I want to extract certain text between two line numbers like 23234234324 and 54446655567567 How do I do this with a simple sed or awk command? Thank you. ---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ---------- found it: sed -n '#1,#2p'... (1 Reply)
Discussion started by: return_user
1 Replies

2. Shell Programming and Scripting

[Video stream] network stream recording with mplayer

Hi I used this command: mplayer http://host/axis-cgi/mjpg/video.cgi -user root -passwd root \ -cache 1024 -fps 25.0 -nosound -vc ffh264 \ -demuxer 3 -dumpstream -dumpfile output.avi It's ok but... Video Playing is very fast! Why? Is it a synch problem? What parameter I have to use for... (1 Reply)
Discussion started by: takeo.kikuta
1 Replies

3. Shell Programming and Scripting

extract specific line if the search pattern is found

Hi, I need to extract <APPNUMBER> tag alone, if the <college> haas IIT Chennai value. college tag value will have spaces embedded. Those spaces should not be suppresses. My Source file <Record><sno>1</sno><empid>E0001</empid><name>Rejsh suderam</name><college>IIT ... (3 Replies)
Discussion started by: Sekar1
3 Replies

4. Shell Programming and Scripting

Extract character between specific line numbers

Hi guys, I have txt file and I would need to extract all the contents between specific line numbers. Line 1: apple Line 2: orange Line 3: mango Line 4: grapes Line 5: pine apple I need to extract the content between line 2 and 4, including the contents of Line 2 and 4 so the ouput... (2 Replies)
Discussion started by: gowrishankar05
2 Replies

5. Shell Programming and Scripting

Using awk to read a specific line and a specific field on that line.

Say the input was as follows: Brat 20 x 1000 32rf Pour 15 p 1621 05pr Dart 10 z 1111 22xx My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour" I currently have this line but it is... (6 Replies)
Discussion started by: Bungkai
6 Replies

6. Shell Programming and Scripting

Search for a pattern,extract value(s) from next line, extract lines having those extracted value(s)

I have hundreds of files to process. In each file I need to look for a pattern then extract value(s) from next line and then search for value(s) selected from point (2) in the same file at a specific position. HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V TITLE CYTOCHROME... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies

7. Shell Programming and Scripting

sed or awk, cut, to extract specific data from line

Hi guys, I have been trying to do this, but... no luck so maybe you can help me. I have a line like this: Total Handled, Received, on queue Input Mgs: 140 / 14 => 0 I need to, get the number after the / until the =, to get only 14 . Any help is greatly appreciated. Thanks, (4 Replies)
Discussion started by: ocramas
4 Replies

8. UNIX for Dummies Questions & Answers

Extract specific contents from each line

Hi all, Happy new year! Here I have a problem with extract specific information from each line in unix: My file is the dbSNP flat file, take two SNPs for examples: REFSNP-DOCSUM-SET (FULL-DUMP) CREATED ON: 2012-06-08 10:50 rs782 | human | 9606 | snp | genotype=NO |... (6 Replies)
Discussion started by: luoruicd
6 Replies

9. Shell Programming and Scripting

Extract & Manipulate continous data stream-- tcpdump

Hello; I have this rather tricky problem to solve --(to me, anyways) .. I am processing the following one liner with tcpdump.. tcpdump -i T3501 -A ether host 00:1e:49:29:fc:c9 or ether host 00:1b:2b:86:ec:1b or ether host 00:21:1c:98:a4:08 and net 149.83.6.0/24 | grep --line-buffered -B... (5 Replies)
Discussion started by: delphys
5 Replies

10. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies
STDIO_EXT(3)						     Linux Programmer's Manual						      STDIO_EXT(3)

NAME
__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE structure SYNOPSIS
#include <stdio.h> #include <stdio_ext.h> size_t __fbufsize(FILE *stream); size_t __fpending(FILE *stream); int __flbf(FILE *stream); int __freadable(FILE *stream); int __fwritable(FILE *stream); int __freading(FILE *stream); int __fwriting(FILE *stream); int __fsetlocking(FILE *stream, int type); void _flushlbf(void); void __fpurge(FILE *stream); DESCRIPTION
Solaris introduced routines to allow portable access to the internals of the FILE structure, and glibc also implemented these. The __fbufsize() function returns the size of the buffer currently used by the given stream. The __fpending() function returns the number of bytes in the output buffer. For wide-oriented streams the unit is wide characters. This function is undefined on buffers in reading mode, or opened read-only. The __flbf() function returns a nonzero value if the stream is line-buffered, and zero otherwise. The __freadable() function returns a nonzero value if the stream allows reading, and zero otherwise. The __fwritable() function returns a nonzero value if the stream allows writing, and zero otherwise. The __freading() function returns a nonzero value if the stream is read-only, or if the last operation on the stream was a read operation, and zero otherwise. The __fwriting() function returns a nonzero value if the stream is write-only (or append-only), or if the last operation on the stream was a write operation, and zero otherwise. The __fsetlocking() function can be used to select the desired type of locking on the stream. It returns the current type. The type argu- ment can take the following three values: FSETLOCKING_INTERNAL Perform implicit locking around every operation on the given stream (except for the *_unlocked ones). This is the default. FSETLOCKING_BYCALLER The caller will take care of the locking (possibly using flockfile(3) in case there is more than one thread), and the stdio routines will not do locking until the state is reset to FSETLOCKING_INTERNAL. FSETLOCKING_QUERY Don't change the type of locking. (Only return it.) The _flushlbf() function flushes all line-buffered streams. (Presumably so that output to a terminal is forced out, say before reading keyboard input.) The __fpurge() function discards the contents of the stream's buffer. SEE ALSO
flockfile(3), fpurge(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2001-12-16 STDIO_EXT(3)
All times are GMT -4. The time now is 07:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy