Sponsored Content
Full Discussion: Uncommenting the file
Top Forums Shell Programming and Scripting Uncommenting the file Post 302656013 by midhun19 on Thursday 14th of June 2012 06:42:35 AM
Old 06-14-2012
Uncommenting the file

hi i have a file in the below fomat
Code:
######################################
# some data
# .....
######################################
file value 
# param1 
# param2

I want to remove the comment of the parameters but not the header...i want the file in the below format
Code:
######################################
# some data
# .....
######################################
file value 
param1 
param2

I have used
Code:
sed -e 's/^#[ ]*//g' <file name>

but this uncommenting the header also and giving me

Code:
######################################
 some data
.....
 ######################################
 file value 
 param1 
param2

is there any way to start replace only after the line after "file value" ie ,if i get the file value line number (in this case 5), can we ask the sed to start replacing only after 5 th line till the end of the file

Moderator's Comments:
Mod Comment Please use code tags, thanks!

Last edited by zaxxon; 06-14-2012 at 07:52 AM.. Reason: code tags, see PM
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

2. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

3. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
PTAINTERPOLATE(1)						  LIBPANO13 TOOLS						 PTAINTERPOLATE(1)

NAME
PTAInterpolate - Interpolate intermediate images between stereo photos. SYNOPSIS
PTAInterpolate script_file [param2] DESCRIPTION
PTAInterpolate Interpolate intermediate images between stereo photos. Description: This program is an enhanced version of Helmut Dersch's original PTInterpolate program. PTInterpolate's source code was never released, so this program was written from scratch. It is believed that this program should function as a substitute for the original PTInterpolate program in most circumstances. Enhancements to the original PTInterpolate program include: 1. When used with the accompanying source code in the original distribution, the output is in TIFF format, not PSD (with an incorrect extension) 2. The output files produced by this program include a numeric value indicating the amount of the interplation position between left and right images 3. If no valid "i" lines are included in script, then this program triangulates the c lines, and ovrewrites the script file Usage: PTAInterpolate script.txt [param2] Where "param2" is either an image index (0=left, 1=right) to be used when triangulating, or a filename prefix to be used when interpolat- ing. SEE ALSO
<http://wiki.panotools.org/> AUTHORS
Max Lyons, January 2007. Panorama Tools was originally created by Professor Helmut Dersch. 2.9.18 2009-05-01 PTAINTERPOLATE(1)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy