08-26-2014
I agree with everything bakunin said.
In addition, I'll add a few more comments:
- I don't understand why you are so interested in printing lines 1 and 3. I don't see anything in the objectives stated in the homework template saying anything about any line number (although it might be appropriate to assume that the header is one line and that that line is the 1st line in the file).
- For the stated problem, awk, grep, and sed seem like logical choices to me.
- If you want to print lines selected by line numbers, awk and sed would still seem to be logical choices.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Input file 1:
>pattern_5
GAATTCGTTCATGTAGGTTGASDASFGDSGRTYRYGHDGSDFGSDGGDSGSDGSDFGSDF
ATTTAATTATGATTCATACGTCATATGTTATTATTCAATCGTATAAAATTATGTGACCTT
SDFSDGSDFKSDAFLKJASLFJASKLFSJAKJFHASJKFHASJKFHASJKFHSJAKFHAW
>pattern_1
AAGTCTTAAGATATCACCGTCGATTAGGTTTATACAGCTTTTGTGTTATTTAAATTTGAC... (10 Replies)
Discussion started by: patrick87
10 Replies
2. Shell Programming and Scripting
I got long list of reference file
>data_tmp_number_22
>data_tmp_number_12
>data_tmp_number_20
.
.
Input file:
>sample_data_1 Math, 5, USA, tmp
SDFEWRWERWERWRWER
FSFDSFSDFSDGSDGSD
>sample_data_2 Math, 15, UK, tmp
FDSFSDFF
>sample_data_3 Math, 50, USA, tmp
ARQERREQR
.
.
Desired... (7 Replies)
Discussion started by: perl_beginner
7 Replies
3. UNIX for Dummies Questions & Answers
HI,
while using banner command, i am not getting the full content in the screen:
banner "UNIX AUTOMATION"
# # # # ### # # # # # ####### ####### # #
# # ## # # # # # # # # # # # ## ##
# # # # # # ... (5 Replies)
Discussion started by: pandeesh
5 Replies
4. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Using the fixed length field file called famous.dat make a one-line Unix command - using pipe(s) - to display an... (5 Replies)
Discussion started by: wizardoz123456
5 Replies
5. Shell Programming and Scripting
i have a input of csv file as below but the sequence of column get changed.
I,e it is not necessary that name comes first then age and rest all, it may vary.
name,age,marks,roll,section
kevin,25,80,456,A
Satch,23,56,789,B
Meena,24,78,H245,C
So i want to print that column entires which... (12 Replies)
Discussion started by: millan
12 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone,
I have UNIX this semester and I am just getting started with the commands. An interesting question came up while discussing the head and tail commands.
Suppose that I have text file with the following data in the following format-:
NAME ROLL MARKS
Sam 05 ... (2 Replies)
Discussion started by: sreyan32
2 Replies
7. UNIX for Dummies Questions & Answers
Hi guys !
I generated the power set of the set S={a,b,c} using crunch:
crunch 1 3 abc
and get the 39 possible subsets:
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
… (2 Replies)
Discussion started by: beca123456
2 Replies
8. Shell Programming and Scripting
Hi,
I need to display specific columns using select statement and spooled to a file and sending it as e-mail. But i am not seeing column header in my output even i use SET HEADING ON.//PREDEFINED LOGIN DETAILS
${ORACLE_HOME}/bin/sqlplus -s ${DB_LOGIN}/${DB_PASSWD} <<EOF
SET FEEDBACK OFF
SET... (1 Reply)
Discussion started by: pvelmuru
1 Replies
9. Shell Programming and Scripting
Hi Team,
Not getting the file output inside my email which i am sending from unix box. . Please refer the below code :
#!/bin/sh
{
sleep 5
echo ehlo 10.56.185.13
sleep 3
echo mail from: oraairtel@CNDBMUREAPZP02.localdomain
sleep 3
echo rcpt to: saurabhtripathi@anniksystems.com... (1 Reply)
Discussion started by: tripathi1990
1 Replies
10. Shell Programming and Scripting
Hi All,
I want to send the csv to an email address.
I have tried the below two approaches.
Approach1: Got error -ksh: uuencode: not found
$ uuencode test_file.csv test_file.csv | mailx -s "Attaching test" msdc.kiran@gmail.com </usr/home/test_file.csv
-ksh: uuencode: not found
Approach2:... (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies
NL(1) User Commands NL(1)
NAME
nl - number lines of files
SYNOPSIS
nl [OPTION]... [FILE]...
DESCRIPTION
Write each FILE to standard output, with line numbers added. With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-b, --body-numbering=STYLE
use STYLE for numbering body lines
-d, --section-delimiter=CC
use CC for separating logical pages
-f, --footer-numbering=STYLE
use STYLE for numbering footer lines
-h, --header-numbering=STYLE
use STYLE for numbering header lines
-i, --line-increment=NUMBER
line number increment at each line
-l, --join-blank-lines=NUMBER
group of NUMBER empty lines counted as one
-n, --number-format=FORMAT
insert line numbers according to FORMAT
-p, --no-renumber
do not reset line numbers at logical pages
-s, --number-separator=STRING
add STRING after (possible) line number
-v, --starting-line-number=NUMBER
first line number on each logical page
-w, --number-width=NUMBER
use NUMBER columns for line numbers
--help display this help and exit
--version
output version information and exit
By default, selects -v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn. CC are two delimiter characters for separating logical pages, a missing second
character implies :. Type \ for . STYLE is one of:
a number all lines
t number only nonempty lines
n number no lines
pBRE number only lines that contain a match for the basic regular expression, BRE
FORMAT is one of:
ln left justified, no leading zeros
rn right justified, no leading zeros
rz right justified, leading zeros
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report nl translation bugs to <http://translationproject.org/team/>
AUTHOR
Written by Scott Bartram and David MacKenzie.
COPYRIGHT
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for nl is maintained as a Texinfo manual. If the info and nl programs are properly installed at your site, the com-
mand
info coreutils 'nl invocation'
should give you access to the complete manual.
GNU coreutils 8.22 June 2014 NL(1)