Sponsored Content
Top Forums Shell Programming and Scripting Adding a columnfrom a specifit line number to a specific line number Post 302194093 by aju_kup on Monday 12th of May 2008 08:10:41 AM
Old 05-12-2008
Code:
awk ' NR >=1 && NR <= 200 { print $0 " Hello" }
        NR >=201 && NR <=800 { print $0 " Goodbye"}
        NR >=801 && NR <=1000 { print $0 " live"}' <filename>

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending line number to each line and getting total number of lines

Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me. I have a file say: abc def ccc ddd ffff The output should be: Instance1=abc Instance2=def Instance3=ccc Instance4=ddd Instance5=ffff ... (2 Replies)
Discussion started by: chiru_h
2 Replies

2. Shell Programming and Scripting

how to get the data from line number 1 to line number 100 of a file

Hi Everybody, I am trying to write a script that will get some perticuler data from a file and redirect to a file. My Question is, I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line. I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies

3. Shell Programming and Scripting

merging line and adding number

I having file below o/p ibapp311dg,,20480,s,,,,,,,,, test,,20480,s,,,,,,,,, test,,20480,s,,,,,,,,, ibapp311dg,,20480,s,,,,,,,,, I want to to chk unique word line in the first field seperated by , as well as addup corressponding the number in field for each unique word like ibapp311dg... (8 Replies)
Discussion started by: tarunn.dubeyy
8 Replies

4. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

5. Shell Programming and Scripting

How would i delete a line at specific line number

Hi guys , I m writing a script to delete a line at particular location. But i m unable to use variable for specifying line number. for example. sed -n '7!p' filename works fine and deletes 7th line from my file but sed -n '$variable!p' filename gives following error. sed: -e... (12 Replies)
Discussion started by: pinga123
12 Replies

6. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

7. Shell Programming and Scripting

Write $line number into textfile and read from line number

Hello everyone, I don't really know anything about scripting, but I have to manage to make this script, out of necessity. #!/bin/bash while read -r line; do #I'm reading from a big wordlist instructions using $line done Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
4 Replies

8. Shell Programming and Scripting

adding line number to *end* of records in file

Given a file like this: abc def ghi I need to get to somestandardtext abc1 morestandardtext somestandardtext def2 morestandardtext somestandardtext ghi3 morestandardtext Notice that in addition to the standard text there is the line number added in as well. What I conceived is... (4 Replies)
Discussion started by: edstevens
4 Replies

9. Shell Programming and Scripting

Cut from specific line number to a line number

Hi All, I've a file like this.. Sheet1 a,1 a,2 a,3 a,4 a,5 Sheet2 a,6 a,7 a,8 a,9 a,10 Sheet3 a,11 a,12 a,13 (7 Replies)
Discussion started by: manab86
7 Replies

10. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies
DT2DV(1)						      General Commands Manual							  DT2DV(1)

NAME
dt2dv - convert a DTL text representation of a TeX DVI file to a binary DVI file SYNOPSIS
dt2dv [-debug] [-group] [-si] [-so] [input-DTL-file] [output-DVI-file] In the absence of the -si and -so options, both file arguments are required in the order input-DTL-file output-DVI-file . But also see the OPTIONS section below. No default file extensions are supplied. DESCRIPTION
dt2dv converts a text representation of a TeX DVI file, usually produced by the companion dv2dt(1) utility, back to a binary DVI file. DTL (DVI Text Language) files can be edited, with care, and then restored to DVI form for processing by any TeX DVI driver program. In DTL files, font directory names and font names are preceded by a length field, which must be updated if the names are modified. dvitype(1) can also display a textual representation of DVI files, but in some implementations at least, it cannot be used in batch mode, and its output is not well-suited for conversion back to a DVI file. The format of TeX DVI files is fully described in Donald E. Knuth, TeX: The Program, Addison-Wesley (1986), ISBN 0-201-13437-3, as well as in the dvitype(1) literate program source code. Brief descriptions of the DTL and DVI formats are given in dv2dt(1). OPTIONS
-debug Turn on detailed debugging output. -group Expect each DTL command to be in parentheses. -si Read all DTL commands from standard input. -so Write all DVI commands to standard output. SEE ALSO
dv2dt(1), dvitype(1), tex(1). FILES
*.dvi binary TeX DVI file. *.dtl text representation of a TeX DVI file in DVI Text Language format. AUTHOR
dt2dv and dv2dt(1) were written by Geoffrey Tobin Department of Electronic Engineering La Trobe University Bundoora, Victoria 3083 Australia Tel: +61 3 479 3736 FAX: +61 3 479 3025 Email: <G.Tobin@ee.latrobe.edu.au> These manual pages were written primarily by Nelson H. F. Beebe, Ph.D. Center for Scientific Computing Department of Mathematics University of Utah Salt Lake City, UT 84112 Tel: +1 801 581 5254 FAX: +1 801 581 4148 Email: <beebe@math.utah.edu> Version 0.6.0 08 March 1995 DT2DV(1)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy