Sponsored Content
Top Forums Shell Programming and Scripting Printing the lines that appear in an other file, and the three lines after them Post 302645373 by jbi on Wednesday 23rd of May 2012 09:41:18 AM
Old 05-23-2012
The first lines of my input are :
Code:
@SRR407306.1 GA2MACHINE1_1004:1:1:1139:9772 length=74      <-header
TCCCTAGCTTCTCTGGTGAGNTATNANNCAAGGTCCCTAANNNNNNNNNNTTAACACATGAANNNNNNNNNGTC
+SRR407306.1
EGGGDGGGDGGGGFGFEGDC#AAA#A##AB?B??GGGED=##########ACC@EEEEE>?#############
@SRR407306.2 GA2MACHINE1_1004:1:1:1139:5426 length=74      <-header
AATCTTGGCTCACTGCAACCNCCGNCNNCCTGGTTCAAGCNNNNNNNNNNCCTCAGCCTCCCNNNNNNNNNAGA
+SRR407306.2
F=FDEFEF:FFFFDFFB?B<#=>A#;##?=A@>7A?DDA6##########2A>=??ACCCB@############
@SRR407306.3 GA2MACHINE1_1004:1:1:1139:20595 length=74    <-header
TAGGAAGGCAGCTATGATGGNTCANGNNCAGGAAGGTGGGNNNNNNNNNNCAGCCTCCCTGANNNNNNNNNTCG

The file contains approximately 200 million lines.
I would also be glad if you could give me a bit of explanation on your code, so I can adapt it by myself if I need it.
Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

question about printing number of lines in a file

as the title, I had try use "wc -l test.txt" but it give me "<many spaces> 384 test.txt" but the result I want is just "384" could any person can help me that? Thx:( (5 Replies)
Discussion started by: a8111978
5 Replies

2. Shell Programming and Scripting

printing first n lines in a file without using head

i have to print first n lines of a file. how can i do that without using head command. for some reason i do not want to use Head. is there a way to get that result using awk or sed?. i an using this on korn shell for AIX Thanks.. (7 Replies)
Discussion started by: dareman123
7 Replies

3. UNIX for Dummies Questions & Answers

Counting no. of lines and printing it at the start of the file

Dear users, I need to count the number of lines in a simple text file and print the number on the first line of that same file. I know I can count the lines using wc -l file.txt this gives for example 100 file.txt I need the number 100 to be printed at the very top of file.txt... (2 Replies)
Discussion started by: jenjen_mt
2 Replies

4. Shell Programming and Scripting

printing lines to a file from a particular string

Hi, A very Good Evening to All, I am writing a script for my application. I have a file with 1000 lines. Among that 1000 lines i am searching for a particular string. And from that string i need to pull all the data in to a seperate file. For example the contents of my file is as below. ... (4 Replies)
Discussion started by: intiraju
4 Replies

5. UNIX for Dummies Questions & Answers

ASCII file printing staggered lines

I am trying to print a simple ascii file but it comes out as a staggered output. I know there's a simple solution but can't remember it, am a little rusty. eg. a file that look like aa bbb cccc would print out like aa bbb ccccc Any pointers would be... (5 Replies)
Discussion started by: lordvoldemort
5 Replies

6. Shell Programming and Scripting

Printing several lines of a file after a specific expression

Hello, I want to print a number of lines of a file after a specific expression of a line. I have this sed command but it prints only 1 line after the expression. How could I adapt it to print for instance 10 lines after or 15 lines after ? sed -n '/regexp/{n;p;}' Thx & Regs, Rany. (5 Replies)
Discussion started by: rany1
5 Replies

7. Shell Programming and Scripting

Printing all lines before a specific string and a custom message 2 lines after

Hello all, I need to print all the lines before a specific string and print a custom message 2 lines after that. So far I have managed to print everything up the string, inclusively, but I can't figure out how to print the 2 lines after that and the custom message. My code thus far is:... (4 Replies)
Discussion started by: SEinT
4 Replies

8. Shell Programming and Scripting

Trouble printing multiple lines to a new file

Hi, I'm trying to auto generate some php files with a default preamble at the top which is a block comment. The problem is that my output has no new lines and it looks like the output from "ls" is being printed after everyline This is my code #!/bin/bash read -d '' pre_amble... (1 Reply)
Discussion started by: racshot65
1 Replies

9. Shell Programming and Scripting

Printing out duplicate lines in a file with Csh

Hi guys, I was wondering if there was an easy solution, using tcsh, to print out lines that appear twice with a given pattern in a file? So if I am looking for lines with "test" in a given file that contains: blah test blah1 blah //don't print this out as it doesn't have... (3 Replies)
Discussion started by: chu816
3 Replies

10. Shell Programming and Scripting

Printing next two lines from a file after grepping a specific pattern

Hi I have a file like # vi require.txt 1,BANK,Read blocks that cycle. yellow Read blocks. 2,ACCOUNT,Finished Red Finished . 3,LOAN, pipe white pipe 4,PROFIT,Resolve. black Resolve Am using like cat require.txt | grep -w ACCOUNTThe output I get is (8 Replies)
Discussion started by: Priya Amaresh
8 Replies
T1ASCII(1)						      General Commands Manual							T1ASCII(1)

NAME
t1ascii - convert PostScript Type 1 font from binary to ASCII SYNOPSIS
t1ascii [-l length] [input [output]] DESCRIPTION
t1ascii converts Adobe Type 1 font programs in PFB (binary) format to PFA (hexadecimal) format. If the file output is not specified output goes to the standard output. If the file input is not specified input comes from the standard input. OPTIONS
--line-length=num, -l num Set the maximum length of encrypted lines in the output to num. (These are the lines consisting wholly of hexadecimal digits.) The default is 64. --warnings, -w Warn when the input font contains lines longer than 255 characters. Long lines don't strictly conform to Adobe's Document Structuring Conventions, and may cause problems with older software. SEE ALSO
t1binary(1), t1unmac(1), t1mac(1), t1asm(1), t1disasm(1) Adobe Type 1 Font Format AUTHORS
Lee Hetherington (ilh@lcs.mit.edu) Eddie Kohler (ekohler@gmail.com) Ported to Microsoft C/C++ Compiler and MS-DOS operating system by Kai-Uwe Herbing (herbing@netmbx.netmbx.de). Version 1.37 T1ASCII(1)
All times are GMT -4. The time now is 08:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy