Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to get/print the lines from a specified file ? (LINUX) Post 302271042 by Lakris on Tuesday 23rd of December 2008 03:47:14 PM
Old 12-23-2008
Great!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print all even lines of a txt file

In other news, I have a colors text file with hundreds of lines, and I want to print only the even numbered lines. for example I have this file looks something like this: ALLCOLORS.TXT red red green red blue red red red green red red blue green green green blue blue blue red blue blue blue... (1 Reply)
Discussion started by: ajp7701
1 Replies

2. Shell Programming and Scripting

Need to print certain lines from a file

Hi ALL, I want to print lines from file using certain conditions for exmple: # The following commands will create a new control file and use it # to open the database. # The contents of online logs will be lost and all backups will # be invalidated. Use this only if online logs are... (25 Replies)
Discussion started by: jack00423
25 Replies

3. UNIX for Advanced & Expert Users

How to print data between 2 lines in a file

i want to print the data between two line numbers in file to another file. which command should i use i tried sed command . i am storing the line numbers in two variables say L1,L2. but $L1 and $L2 are not working in sed command. is there any other command to do this reply soon (5 Replies)
Discussion started by: kamesh83
5 Replies

4. UNIX for Dummies Questions & Answers

find lines from one file in the other and print them

Hi guys, please help me to make a loop! I have two files. File 1 2 4 7 File2 1 abc 2 cde 3 ghgj 4 kjhn 5 mbm 6 hghj 7 hgjk I need to write a script that reads lines from File1, finds them in File2 and puts in File3, so File3 should look like this: (3 Replies)
Discussion started by: coppuca
3 Replies

5. Shell Programming and Scripting

how to print the certain lines in a file to different files

Hi All, File that I have: <ct> <name>group <value>1 <value>2 <value>3 </ct>-->file The output that I needed is <ct> <name>group <value>1 -->file1 <ct> <name>group <value>2 -->file2 (6 Replies)
Discussion started by: natalie23
6 Replies

6. Windows & DOS: Issues & Discussions

Print lines 20-30 from a file

Hi I want to print lines 20-30 from a file. In UNIX , this command will work sed -n '20,30p' file However what is the equivalent command in DOS ? Pls help me ! (2 Replies)
Discussion started by: dashing201
2 Replies

7. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

8. Shell Programming and Scripting

Strings from one file which exactly match to the 1st column of other file and then print lines.

Hi, I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines). ################################# huge_file.txt a a ab b ################################## small_file.txt a 1.5 b 2.5 ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 Replies

9. Shell Programming and Scripting

Print matching lines in a file

Hello everyone, I have a little script below: die "Usage infile outfile reGex" if @ARGV != 3; ($regex) = @ARGV; open(F,$ARGV) or die "Can't open"; open(FOUT,"+>$ARGV") or die "Can't open"; while (<F>) { print FOUT if /$regex/.../$regex/; } No matter what I give $regex on the... (2 Replies)
Discussion started by: new bie
2 Replies

10. UNIX for Dummies Questions & Answers

Compare 2 files print the lines of file 2 that contain a string from file 1

Hello I am a new unix user, and I have a work related task to compare 2 files and print all of the lines in file 2 that contain a string from file 1 Note: the fields are in different columns in the files. I suspect the is a good use for awk? Thanks for your time & help File 1 123 232 W343... (6 Replies)
Discussion started by: KevinRidley
6 Replies
Output(3pm)						User Contributed Perl Documentation					       Output(3pm)

NAME
SGMLS::Output - Stack-based Output Procedures SYNOPSIS
use SGMLS::Output; To print a string to the current output destination: output($data); To push a new output level to the filehandle DATA: push_output('handle',DATA); To push a new output level to the file "foo.data" (which will be opened and closed automatically): push_output('file','foo.data'); To push a new output level to a pipe to the shell command "sort": push_output('pipe','sort'); To push a new output level appending to the file "foo.data": push_output('append','foo.data'); To push a new output level to an empty string: push_output('string'); To push a new output level appending to the string "David is ": push_output('string',"David is "); To push a new output level to The Great Beyond: push_output('nul'); To revert to the previous output level: pop_output(); To revert to the previous output level, returning the contents of an output string: $data = pop_output(); DESCRIPTION
This library allows redirectable, stack-based output to files, pipes, handles, strings, or nul. It is especially useful for packages like SGMLS, since handlers for individual SGML elements can temporarily change and restore the default output destination. It is also particu- larly useful for capturing the contents of an element (and its sub-elements) in a string. Example: sgmls('<title>', sub{ push_output('string'); }); sgmls('</title>', sub{ $title = pop_output(); }); In between, anything sent to output (such as CDATA) will be accumulated in the string returned from pop_output(). Example: sgmls('<tei.header>', sub { push_output('nul'); }); sgmls('</tei.header>', sub { pop_output(); }); All output will be ignored until the header has finished. AUTHOR AND COPYRIGHT
Copyright 1994 and 1995 by David Megginson, "dmeggins@aix1.uottawa.ca". Distributed under the terms of the Gnu General Public License (version 2, 1991) -- see the file "COPYING" which is included in the SGMLS.pm distribution. SEE ALSO
: SGMLS. perl v5.8.8 2004-02-22 Output(3pm)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy