Sponsored Content
Top Forums Shell Programming and Scripting How to replace a range of text with sed or awk? Post 302307206 by zaxxon on Wednesday 15th of April 2009 12:49:34 AM
Old 04-15-2009
Show an example please and use CODE tags, ty.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed/awk date range?

Hi, I am trying to grep out a date range in an access log file. I defined the date like so; DATE1=$(date --date '1 hour ago' '+%m/%d/%y:%H:%M:%S') DATE2=$(date '+%m/%d/%y:%H:%M:%S') Then I just used cat to get the hits to the url into a results.txt; touch /tmp/results.txt cat... (7 Replies)
Discussion started by: Epx998
7 Replies

2. Shell Programming and Scripting

using sed/awk to replace a block of text in a file?

My apologies if this has been answered in a previous post. I've been doing a lot of searching, but I haven't been able to find what I was looking for. Specifically, I am wondering if I can utilize sed and/or awk to locate two strings in a file, and replace everything between those two strings... (12 Replies)
Discussion started by: kiddsupreme
12 Replies

3. Shell Programming and Scripting

sed replace range of characters in each line

Hi, I'm trying to replace a range of characters by their position in each line by spaces. I need to replace characters 95 to 145 by spaces in each line. i tried below but it doesn't work sed -r "s/^(.{94})(.{51})/\ /" inputfile.txt > outputfile.txt can someone please help me... (3 Replies)
Discussion started by: Kevin Tivoli
3 Replies

4. UNIX for Dummies Questions & Answers

Using sed to replace a range of number

Trying to use SED to replace numbers that fall into a range but can't seem to get the logic to work and am wondering if SED will do this. I have a file with the following numbers 3 26 20 5. For the numbers that are greater than zero and less than 25, SED would add the word range after the... (7 Replies)
Discussion started by: jimmyf
7 Replies

5. Debian

Using awk and sed to replace text

Good Day Every one I have a problem finding and replacing text in some large files that will take a long time to manually edit. Example text file looks like this #Example Large Text File unix linux dos squid bind dance bike car plane What im trying to do is to edit all the... (4 Replies)
Discussion started by: linuxjunkie
4 Replies

6. Shell Programming and Scripting

Get range out using sed or awk, only if given pattern match

Input: START OS:: UNIX Release: xxx Version: xxx END START OS:: LINUX Release: xxx Version: xxx END START OS:: Windows Release: xxx Version: xxx ENDHere i am trying to get all the information between START and END, only if i could match OS Type. I can get all the data between the... (3 Replies)
Discussion started by: Dharmaraja
3 Replies

7. Shell Programming and Scripting

awk to print text in field if match and range is met

In the awk below I am trying to match the value in $4 of file1 with the split value from $4 in file2. I store the value of $4 in file1 in A and the split value (using the _ for the split) in array. I then strore the value in $2 as min, the value in $3 as max, and the value in $1 as chr. If A is... (6 Replies)
Discussion started by: cmccabe
6 Replies

8. Shell Programming and Scripting

sed or awk to remove specific column to one range

I need to remove specific column to one range source file 3 1 000123456 2 2 000123569 3 3 000123564 12 000123156 15 000125648 128 000125648 Output required 3 000123456 2 000123569 3 000123564 12 000123156 15 000125648 128 000125648 (6 Replies)
Discussion started by: ranjancom2000
6 Replies

9. UNIX for Beginners Questions & Answers

Sed/awk to delete a regex between range of lines

Hi Guys I am looking for a solution to one problem to remove parentheses in a range of lines. Input file module bist_logic_inst(a, ab , dhd, dhdh , djdj, hdh, djjd, jdj, dhd, dhp, dk ); input a; input ab; input dhd; input djdj; input dhd; output hdh; output djjd; output jdj;... (5 Replies)
Discussion started by: kshitij
5 Replies

10. UNIX for Beginners Questions & Answers

Help with awk or sed Command to Replace Text in Files

Hello Everyone, I have many files like so: file1.txt file2.txt file3.txt Within each file I have many lines of random text separated by commas like so: abcAAA,123,defAA,456777,ghiA,789 jklB,101,mnoBBB,11211,pqrB,13111 stuCC,415,vwxCCCC,161,yzaC,718 I am trying to use SED or AWK to... (4 Replies)
Discussion started by: D3U5X
4 Replies
KATEDEC(1)							      libkate								KATEDEC(1)

NAME
katedec - decodes Kate streams to a textual description SYNOPSIS
katedec [-hVv] [-o outfile] [-t type] [ infile ] DESCRIPTION
katedec decodes Kate streams to libkate's custom description language. OPTIONS
-h Show command line help. -V Show version information. -v Increase verbosity. -o outfile Write the output description file to the given file name (writes to stdout if not specified). It is possible to write to multiple files (eg, if the input contains several Kate streams) by passing printf style formatting tags in the filename. Formatting tags are strings starting with a '%' character, followed by the tag itself. Known tags are: % replaced by a verbatim % character l replaced by the stream language c replaced by the stream category s replaced by the stream serial number, in hexadecimal format i replaced by the index of the stream in the input file, starting from 0 -t type Set the output format type: kate: Kate description format srt: SubRip format (non text information will be lost) EXAMPLES
Decodes a Kate stream to a textual description: katedec -o output.kate input.ogg Decodes several multiplexed Kate streams to SubRip files: katedec -t srt -o output.%l.kate input.ogg SEE ALSO
kateenc(1), katalyzer(1) libkate 0.4.1 01 september 2008 KATEDEC(1)
All times are GMT -4. The time now is 01:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy