Sponsored Content
Top Forums Shell Programming and Scripting Using sed to delete string between delimiters Post 302145212 by Klashxx on Tuesday 13th of November 2007 08:39:38 AM
Old 11-13-2007
try
Code:
> echo 'P1|10,9:12/123456789|,10:1|11,10:60|15,9:5/12345|,10:1|'|sed -e "s_|[^|]*:_|_g"
P1|12/123456789|1|60|5/12345|1|

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using sed to delete a string?

Hi all! Here is my problem : I have a string like the following : 20030613170404;BAN_CAV ; starting script Loader.sh on ; 13/06/2003 at ; 17;04;03 I want to eraze all characters located after "Loader.sh", because there are unuseful. I tried to use sed...but it didnt work....i guess i... (1 Reply)
Discussion started by: HowardIsHigh
1 Replies

2. Shell Programming and Scripting

using sed command to delete a string spanning multiple lines

file1 contains the following data sssssssssss firstline secondline pppppppppp ssssssssss Using sed comamnd i am trying to delete firtsline secondline. so, output should be sssssssssss pppppppppp ssssssssss I tried in the following the way, but it is not working. sed ... (9 Replies)
Discussion started by: radha.kalivar
9 Replies

3. Shell Programming and Scripting

delete multiline string from file using sed.

Hi, I have file which has the following content... GOOD MORNING **********WARNING********** when it kicks from the kickstart, sshd daemon should start at last. (WHEN KICKING ITSELF, NOT AFTER KICKING). /etc/rc3.d/S55sshd ( run level specification for sshd is 55, now I would want to... (4 Replies)
Discussion started by: skmdu
4 Replies

4. Shell Programming and Scripting

SED delete string from till problems

Hi i have a file which contains 2 lines, line 1 is static data. line 2 is a very large string(over 3000char or much more). in that string are tags which i want to delete. e.g. <order1>123</order1><tag1>data</tag1><new>1</new><order2>124</order2><tag1>data</tag1> all one one line. now i... (5 Replies)
Discussion started by: subby80
5 Replies

5. Shell Programming and Scripting

sed delete wildcard within a string

Hi I would like to batch delete the "note" entry from bib files. The start would be defined by "note ={" and the end by "}." (see example bib entry below). I tried the following command which does not have any effect: cat input.bib| sed -e 's/note = {.*}.//' > output.bib Any help would... (2 Replies)
Discussion started by: gerggeismann
2 Replies

6. UNIX for Dummies Questions & Answers

Delete string between delimiters with sed

Hi, I need to delete all text between "|" delimiters. The line in text file typically looks like this: 1014182| 13728 -rw-r--r-- 1 imac1 staff 7026127 2 okt 2010 |/Users/imac1/Music/iTunes/iTunes Media/Music/Various Artists/We Are the World_ U.S.A. for Africa/01 We Are the World.mp3... (2 Replies)
Discussion started by: andrejm
2 Replies

7. Shell Programming and Scripting

SED help delete characters in a string

Hi Please help me to refine my syntax. I want to delete the excess characters from the out put below. -bash-3.00$ top -b -n2 -d 00.20 |grep Cpu|tail -1 | awk -F ":" '{ print $2 }' | cut -d, -f1 4.4% us now i want to delete the % and us. How wil i do that to make it just 4.4. Thanks (7 Replies)
Discussion started by: redtred
7 Replies

8. Shell Programming and Scripting

Delete string between 3rd tab and first pattern with SED

Hello, I have this sentence :Pattern1 Pattern2 Pattern3 Pattern4-which-contains-HELLO-string-and-other-stuff-and-second-HELLO-and-third-HELLO I want to delete everything between the 3rd tab (\t) and the FIRST pattern "HELLO" of the line. Result expected is : Pattern1 ... (7 Replies)
Discussion started by: theclem35
7 Replies

9. Shell Programming and Scripting

delete the line with a particular string in a file using sed command.

Hello, I want to delete all lines with given string in file1 and the string val is dynamic. Can this be done using sed command. Sample: vars="test twinning yellow" for i in $vars do grep $i file1 if then echo "Do Nothing" else sed `/$i/d` file1 fi done Using the above... (5 Replies)
Discussion started by: PrasadAruna
5 Replies

10. Shell Programming and Scripting

sed delete leading spaces in a .csv if not in a string

Solaris, ksh I have a .csv file I am trying to clean up before loading into the database. The file contains comma separated columns that have leading spaces which I need to remove. The trouble is, some columns that should not be touched are strings which happen to have the same pattern in them. ... (4 Replies)
Discussion started by: gary_w
4 Replies
editmoin(1)						      General Commands Manual						       editmoin(1)

NAME
editmoin - Edit MoinMoin wiki pages in your favourite editor SYNOPSIS
editmoin http://moinmo.in/WikiSandBox editmoin -t SomeTemplate http://moinmo.in/WikiSandBox DESCRIPTION
editmoin allows you to edit Moin wiki pages with your preferred editor. It means you can easily edit your pages, without the usual limita- tions of most web browsers' text areas. Its usage is simple and straightforward. Just provide moin's web page url as the first parameter. For example: editmoin http://moinmo.in/WikiSandBox You can also use the -t parameter, to inform a template to base this page on. For example: editmoin -t SomeTemplate http://moinmo.in/WikiSandBox CHANGE SETTINGS
While you're editing a page you'll notice that a few settings are available at the top of the page. These settings are preceded by a @ sym- bol, and are immediately followed by the page body. These settings allow you to inform, for example, if you want subscribing users to be notified of your changes, or provide a comment for your change. Their functionality is simple, and their meaning, format, and usage should be obvious to you. SELECTING YOUR EDITOR
The default editor is vi. If you want to use any other, just set the EDITOR environment variable accordingly. SETTING YOUR USERNAME
For editmoin to be able to authenticate you against the moin site you're accessing, it must know your username. For that, you must edit the file ~/.moin_users and insert URL ID pairs in it. For example: http://moinmo.in YourUserName http://wiki.ubuntu.com http://example.com/moin/moin.cgi AnotherUserName If the server needs Basic HTTP Authentication you can use something like: https://user:password@example.com/moin/moin.cgi YourUserName For using shortcuts (see below), and also for better control, defining URLs without usernames in that file is valid. SETTING YOUR MOIN ID EXPLICITLY
In remote times, authentication was done in moin using an ID, consisting mostly of numbers. Nowadays moin was improved to work with a more traditional username/password scheme. Even then, if the traditional username scheme mentioned above doesn't work for you, IDs may still be obtained after authentication, when the moin site sends your browser a MOIN_ID or MOIN_SESSION cookie. Setting moin IDs consists of changing a file named ~/.moin_ids and inserting URL ID pairs in it. For example: http://moinmo.in 987654321.321.54321 http://wiki.canonical.com http://example.com/moin/moin.cgi 123456789.123.12345 If the server needs Basic HTTP Authentication you can use something like: https://user:password@example.com/moin/moin.cgi 123456789.123.12345 You can use a command like this to create a ~/.moin_ids file from your current Firefox profile: sqlite3 -separator ' ' .mozilla/*/*.default/cookies.sqlite "SELECT host,value FROM moz_cookies WHERE name LIKE 'MOIN_SESSION'" | sed 's_^_https://_' > ~/.moin_ids For using shortcuts (see below), and also for better control, defining URLs without IDs in that file is valid. ALIASES
Besides using shortcuts, it's also possible to define URL aliases in a file named ~/.moin_aliases. This file should contain lines with pairs of "alias translation". For instance: script http://moinmo.in/ScriptMarket With this line present, one may execute a command like follows: editmoin script/EditMoin and get the expected result. Notice that unlike shortcuts, aliases must match exactly to be considered. After the alias is translated, the resulting URL is also pro- cessed for matching shortcuts as specified below. SHORTCUTS
Instead of using the whole URL, you may use a shortcut, which consists of any substring of an URL contained in ~/.moin_users and/or ~/.moin_ids, followed by a slash and an optional subpath. For instance: editmoin canonical/FrontPage PROXIES
If you're behind a proxy, set the http_proxy environment variable, as usual. BACKUPS
Editing a moin page may take several minutes, or even hours sometimes. With this in mind, after you change some page it is saved in a file named ~/.moin_lastedit even before trying to commit it. This gives an extra protection against casual problems. Note that this file is overwritten every time a page is successfuly changed, so save it somewhere if you want to keep it. AUTHOR
editmoin was written by Gustavo Niemeyer <gustavo@niemeyer.net>. This manpage was written by Martin Pitt <mpitt@debian.org> for the Debian GNU/Linux System (but may be used by others), based on editmoin's home page. Martin Pitt February 16, 2008 editmoin(1)
All times are GMT -4. The time now is 02:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy