Put a # in start of a specific line of a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Put a # in start of a specific line of a file
# 8  
Old 06-04-2012
Quote:
Originally Posted by sdf
Code:
awk '/ABC4/{print "#" $0}1' infile >outfile

This prints the line twice, one without modification...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies

2. Shell Programming and Scripting

Bash to goto specific line/function and start processing if user response is yes

In the bash below I am trying to run the script entire script including the ....(which is a bunch of code) and then in the run function if the user response is y (line in bold). then start processing from execute function. Basically, goto the # extract folder for variable filename line and start... (4 Replies)
Discussion started by: cmccabe
4 Replies

3. 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

4. Shell Programming and Scripting

Reading line by line from live log file using while loop and considering only those lines start from

Hi, I want to read a live log file line by line and considering those line which start from time stamp; Below code I am using, which read line but throws an exception when comparing line that does not contain error code tail -F /logs/COMMON-ERROR.log | while read myline; do... (2 Replies)
Discussion started by: ketanraut
2 Replies

5. Shell Programming and Scripting

How to concatene files and put each line of files on a specific position ?

Hi, I have some files that i want to concatene and put each of lines of this files on a specific position : File1 AAAAAAA BBBBBBB CCCCCCC File2 DDDDDDD EEEEEEE FFFFFFF File3 GGGGGG HHHHHH IIIIII New file (6 Replies)
Discussion started by: apippo70
6 Replies

6. Shell Programming and Scripting

How to start reading from the nth line till the last line of a file.

Hi, For my reuirement, I have to read a file from the 2nd line till the last line<EOF>. Say, I have a file as test.txt, which as a header record in the first line followed by records in rest of the lines. for i in `cat test.txt` { echo $i } While doing the above loop, I have read... (5 Replies)
Discussion started by: machomaddy
5 Replies

7. UNIX for Advanced & Expert Users

Appending # to the start of specific line in a properties file

Hi, I have the following file, ABC.txt: ABC=123 DEF=234 FGH=345 Based on my validation and conditional processing it is observed that i need to comment or append # before DEF=234 so the same file ABC.txt should look as follows ABC=123 #DEF=234 FGH=345 Sorry if its a... (6 Replies)
Discussion started by: mihirvora16
6 Replies

8. Shell Programming and Scripting

put a semicolon at the end of each line of a file

hi, Consider there is a file containing 200 lines. please let me know which command is to be used to put a semicolon at the end of each line. if no single command is there then how it can be achieved. (1 Reply)
Discussion started by: surjyap
1 Replies

9. Linux

where to put an application if i want to start it on start up

hi i want to know the way by which i put any file somewhere and it get s started when the system restarts or bots i mean whenever my system starts that application must also start thanks (3 Replies)
Discussion started by: shukla_chanchal
3 Replies
Login or Register to Ask a Question
pnm2ppa(5 Feb 2000)													       pnm2ppa(5 Feb 2000)

NAME
pbm2ppa - convert portable bitmap (PBM) to HP's Printing Performance Architecture (PPA) file format SYNOPSIS
pbm2ppa [options] [ <infile] > [ <outfile]> ] ] DESCRIPTION
Reads portable bitmap (PBM) format as input. Outputs a stream suitable for processing by Hewlett-Packard's range of Printing Performance Architecture (PPA) printers. pnm2ppa supports the HP 710c, 712c, 720c, 722c, 820c, and 1000c series printers. (Portable bitmap (PBM) format output can be produced from PostScript(tm) input by the GhostScript driver "pbmraw".) OPTIONS
infile Input file infile is either a path to a file or device, or '-' to indicate stdin (defaults to stdin) outfile Output file outfile is either a path to a file or device, or '-' to indicate stdout (defaults to stdout) -b bottommargin Sets the bottom margin bottommargin in units of 1/600 inches (e.g., -b 150 = 0.25") -d Displays the current configuration -f configfile Overrides reading the configuration from /etc/pnm2ppa.conf, and uses configfile instead. -h Displays program usage -l leftmargin Sets the left margin leftmargin in units of 1/600 inches (e.g., -l 150 = 0.25") -r rightmargin Sets the right margin rightmargin in units of 1/600 inches (e.g., -r 150 = 0.25") -s papersize Sets the paper size. Possible values for papersize are a4 (A4), letter or us (US Letter, 8.5"x11"), and legal (US Legal, 8.5"x14"). The default is US Letter. -t topmargin Sets the top margin topmargin in units of 1/600 inches (ie -t 150 = 0.25") -v printertype Selects the printer model. Possible values of printertype are: 710, 712, 720, 722, 820 and 1000. The default is the HP DeskJet 7X0 Series (710, 712, 720, 722). -x xoffset Sets the x-offset xoffset from the left of the page. Units are 1/600 inches -y yoffset Sets the y-offset yoffset from the top of the page. Units are 1/600 inches NOTES
The configuration file is read in first. Command line arguments then modify the resulting definitions. The -x and -y options accumulate. The -v option resets all definitions back to an inbuilt default for that printer and should be used before subsequent -b -l -r, -t, -x, and -y arguments. SEE ALSO
pbm(5) FILES
/etc/pbm2ppa.conf Default configuration file AUTHOR
This code is licensed under the GNU Public License version 2. See LICENSE for details. (c) 1998 Tim Norman HISTORY
This program was written by Tim Norman. It originally supported black and white output on the 820 series. This program is almost obsolete; its successor pnm2ppa will support color printing. BUGS
This is a stable driver, but does not support color printing. pnm2ppa(5 Feb 2000)