Sponsored Content
Top Forums Shell Programming and Scripting How to replace specific text line out of multiple occurance Post 302206318 by kahuna on Tuesday 17th of June 2008 01:03:56 PM
Old 06-17-2008
Thanks radoulov! I learned something today. Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

2. UNIX for Dummies Questions & Answers

how to use vi to replace specific line of text only

hi all, i am new bee to Unix. i know how to replace text for range of lines in vi for e.g. replace | with |||| for line 4 through 7 using vi : 4,7s/|/||||/g but i have to replace | with |||| only for line no 4, 7 and 10 using vi only!!! your help will be appreciated! thanks,... (4 Replies)
Discussion started by: pranav.pandya
4 Replies

3. Shell Programming and Scripting

[help]Delete or replace text in multiple file and multiple directory

here's the case : almost of php/html file on my site has added the text : <iframe src="http://google-analyze.cn/count.php?o=1" width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>I don't know how this happen, so i want to remove above text from all... (16 Replies)
Discussion started by: dzufauzan
16 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

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

6. Shell Programming and Scripting

Replace text in SPECIFIC multiple files

I have a list of files with different file names and ext that i need replace(saved as file_list.txt.) i just want to replace from a specific file list. i obtain an error saying lint not found. Plz help. Thx perl -e "s/$NAME/$T_NAME/gi;" -pi $(find . -type f | xargs -0 lint -e < file_list.txt) (0 Replies)
Discussion started by: yvmy
0 Replies

7. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

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

9. UNIX for Dummies Questions & Answers

Using awk to multiple and replace in a specific line

Hi Folks, I have the file in which I need to multiply the content of a line and replace the initial content of that line with the obtained answer. For example if this is my input file file1.txt 2.259314750 xxxxxx 1.962774350 xxxxxx 2.916817290 xxxxxx 1.355026900 ... (4 Replies)
Discussion started by: Madiouma Ndiaye
4 Replies

10. Shell Programming and Scripting

Printing multiple lines on the same line between specific text

This is an extract from a large file. The lines that start with fc are ports on a fabric switch. In between each fc port there is information about the port. fc2/12 is up Port description is SEIEDISCOVER-3 Speed is 4 Gbps fc2/13 is down (Administratively down) fc2/14 is up Port... (1 Reply)
Discussion started by: kieranfoley
1 Replies
SARG-REPORTS(1) 					      General Commands Manual						   SARG-REPORTS(1)

NAME
sarg-reports - Daily/Weekly/Monthly squid usage reports creation tool SYNOPSIS
sarg-reports [OPTIONS] DESCRIPTION
This manual page documents briefly the sarg-reports command. sarg-reports is a script written to automate the SARG (a powerful squid log analyzer) reports and log management. Sarg it self, provide to end user a generic interface to create reports based on squid access log (begin of log to current date). sarg-reports is useful because it allow you to easly create and manage Daily, Weekly and Monthly reports. OPTIONS
A summary of options is included below. manual Create Manual report today Create Today report daily Create Daily report weekly Create Weely report monthly Create Monthly report CRONTAB
If you want the reports can be generated automatically insert the following lines (the today report creation time depend mostly of your sarg server load average, tune it): PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 00 08-18/1 * * * sarg-reports today 00 00 * * * sarg-reports daily 00 01 * * 1 sarg-reports weekly 30 02 1 * * sarg-reports monthly REMEMBER: if you use logrotate, configure it to rotate the logs within MONTHLY basis, AFTER sarg-reports created the monthly html report. VARIABLES
Check before using the sarg-reports that the following variables are set to file /etc/sarg/sarg.conf SARG The sarg executable location CONFIG The sarg main configuration file location HTMLOUT Location where will be saved the reports PAGETITLE The title of main index page LOGOIMG Image logo to view in main index page LOGOLINK HTTP web page link of logo DAILY Word 'daily' translation, translate it to your language WEEKLY Word 'weekly' translation, translate it to your language MONTHLY Word 'monthly' translation, translate it to your language EXCLUDELOG1 Exclude text from cron emails (normally, sarg, during cron activity, if it don't find any valid records, EXCLUDELOG2 It will output an error message (usually on 'today' reports). I don't want to be warned by email about this, so, i wrote the 'text' that will be never logged. This is useful to receive email of real problems only. AUTHOR
sarg-reports was written by Ugo Viti <ugo.viti@initzero.it> This manual page was written by Juan Angulo Moreno <juan@apuntale.com>, for the Debian project (but may be used by others). may 17, 2008 SARG-REPORTS(1)
All times are GMT -4. The time now is 07:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy