Sponsored Content
Top Forums Shell Programming and Scripting Using sed can you specify the last instance of a character on a line? Post 302533480 by Bashingaway on Thursday 23rd of June 2011 07:55:11 PM
Old 06-23-2011
Thanks Scott

Could you explain how that's working possibly.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using SED to append character to each line

Hey - my first post here, and I'm a total SED newb. I've looked around for previous help on this, but have so far been unsuccessful. I have a program (AMStracker for OS X) that outputs data in the terminal. Output is in this form: . . . 3 0 -75 3 0 -76 3 0 -77 ... (4 Replies)
Discussion started by: c0nn0r
4 Replies

2. Shell Programming and Scripting

replace first instance(not first instance in line)

Alright, I think I know what I am doing with sed(which probably means I don't). But I cant figure out how to replace just the first occurance of a string. I have tried sed, ed, and grep but can't seem to figure it out. If you have any suggestions I am open to anything! (3 Replies)
Discussion started by: IronHorse7
3 Replies

3. Shell Programming and Scripting

error while replacing a string by new line character in sed

hi, when i am doing the following things getting error Can anyone please suggest i have a file where there is a line like the following branch=dev sdf dev jin kilii fin kale boyle dev james dev i want to search the existance of dev in the above line. cat "$file" | sed -n... (8 Replies)
Discussion started by: millan
8 Replies

4. Shell Programming and Scripting

sed: remove first character from particular line

Hello Experts, I have a file "tt.txt" which is like: #a1=a2 b1=b2 #c1=c2 I need to remove the pound (#) sign from a particular line. In this case let us assume it's 3rd line : "#c1=c2" I can do it through: sed "s/#c1=c2/c1=c2/" tt.txtbut it is possible that I may not know the value... (6 Replies)
Discussion started by: hkansal
6 Replies

5. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

6. Shell Programming and Scripting

sed or awk delete character in the lines before and after the matching line

Sample file: This is line one, this is another line, this is the PRIMARY INDEX line l ; This is another line The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies

7. Shell Programming and Scripting

Sed: delete on each line before a character and after a character

Hi there, A total sed noob here. Is there a way using sed to delete everything before a character AND after another character on each line in a file? The deletion should also delete the indicating characters(here: an opening and a closing parenthesis). The original file would look like... (3 Replies)
Discussion started by: bnbsd
3 Replies

8. Shell Programming and Scripting

sed - remove begin of line up to the third and including occurence of character

hello. How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ). Any help is welcome. (10 Replies)
Discussion started by: jcdole
10 Replies

9. Shell Programming and Scripting

awk sed to repeat every character on same position from the upper line replacing whitespace

Hello is it possible with awk or sed to replace any white space with the previous line characters in the same position? I am asking this because the file I have doesn't always follow a pattern. For example the file I have is the result of a command to obtain windows ACLs: icacls C:\ /t... (5 Replies)
Discussion started by: nakaedu
5 Replies

10. UNIX for Beginners Questions & Answers

awk or sed to print the character from the previous line after the regexp match

Hi All, I need to print the characters in the previous line just before the regular expression match Please have a look at the input file as attached I need to match the regular expression ^ with the character of the previous like and also the pin numbers and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
diction(1)						      General Commands Manual							diction(1)

NAME
diction, explain, suggest - Prints wordy sentences and looks them up in an interactive thesaurus. SYNOPSIS
diction [-fpattern_file] [-k] [-ma] [-me] [-ml] [-ms] [-n] [file...] explain suggest The diction command finds all sentences in an English language document that contain phrases from a database of bad or wordy diction. The explain command is an interactive thesaurus for the English language phrases found by the diction command and only for those phrases. The diction command reads from standard in if no file operand is provided. The suggest command is a synonym for explain. OPTIONS
Names a user-created pattern file to be used in addition to the default file. Passes the -k option to the deroff command. The -k option keeps blocks of text specified nroff by requests or macros; for example, the request. Passes the -ma option to deroff. The -ma option interprets nroff man macros only. Overrides the default nroff -ms macro package. Causes deroff to skip lists; should be used if a docu- ment contains many lists of nonsentences. Overrides the default nroff -ms macro package. Suppresses use of the default file (used with -f). Only the user-created pattern file is used. DESCRIPTION
Each phrase found by the diction command is enclosed in [ ] (brackets). Because diction runs deroff before looking at the text, include formatting header files as part of the input. Before using the explain command, use the diction command to obtain a list of poorly worded phrases. When you use the explain command, the system prompts you for a phrase and responds with a grammatically acceptable alternative. You can continue typing phrases, or you can exit by pressing the End-of-File key sequence. The explain command can also take input redirected from a file. No other command line arguments are valid. NOTES
Use of nonstandard formatting macros may cause incorrect sentence breaks. In particular, diction does not understand -me. FILES
Default pattern file. Thesaurus used by the explain command. SEE ALSO
Commands: deroff(1), nroff(1) diction(1)
All times are GMT -4. The time now is 11:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy