Sponsored Content
Full Discussion: sed regex
Top Forums UNIX for Dummies Questions & Answers sed regex Post 14390 by Perderabo on Thursday 31st of January 2002 08:35:45 AM
Old 01-31-2002
Try:
sed 's=\(<IMG,[0-9,]*>\)prod/=\1special/='
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using sed and regex to reverse order???

so i have been trying to learn how to manipulate text on my own and have gotten stumped... let's say i have a text file that says (highly simplified): people ordinary How would swap the order of the words.. I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies

2. Shell Programming and Scripting

Sed and regex help needed

Hi all, I'm writing a script that replaces a value in a file. The file is formatted as follows: So, for this example, I'd like to replace the value for param_two. The value for param_two can be a one, or two-digit number. It replaces the value in file.cfg, and directs the... (9 Replies)
Discussion started by: marknu1
9 Replies

3. Shell Programming and Scripting

sed - using regex and | need help

From my understanding when using regex1|regex2 the matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. When im trying to extract the name from those examples: A) name.can.be.different.20.03.2009.boom B)... (2 Replies)
Discussion started by: TehOne
2 Replies

4. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

5. UNIX for Advanced & Expert Users

Sed regex problem

Hi, I tried to extract the time from `date` with sed. (I know it works with `date +%H:%M:%S` as well) I got three solutions of which just one worked. I thought "+" should repeat the previous expression 1 or more times and {n} should repeat the previous expression n times. $ date Thu... (9 Replies)
Discussion started by: thiuda
9 Replies

6. Shell Programming and Scripting

Use regex in replacement string in SED

Hi, I need to use the regex in the replacement string in SED command. something like sed -e ' s/\(^\{5\}\).\{150\}\(.*\)$/\10\{30\}1\{30\}A\{60\}B\{30\}\2/' abc which means for all the lines in file abc that starts with 5 characters, I need to replace character 6-151... (6 Replies)
Discussion started by: snowline84
6 Replies

7. Shell Programming and Scripting

Question on awk/sed/regex

I plan to do something like this in awk that's embedded in a shell script. I have extracted a text file using awk and the output is before example: <USDOLLARS|xxx> I want to use get rid of the starting "<" and anything after the pipe "|" after example: USDOLLARS How do I do that?? I... (8 Replies)
Discussion started by: deadyetagain
8 Replies

8. Shell Programming and Scripting

Help with sed substitution / regex

Hi all, please can anyone show me how to use sed and regular expressions to achieve the following. If a line contains a capital A followed by exactly 5 or 6 characters followed by an angled bracket then insert an asterix before the angled bracket. So: XCONFIGA12345<X Becomes: ... (5 Replies)
Discussion started by: Jedimark
5 Replies

9. Shell Programming and Scripting

Multiple regex in sed

I am using the following sed script to remove new lines (\r\n and \n), except from lines starting with >: sed -i ':a /^>/!N;s/\r\n\(\)/\1/;s/\n\(\)/\1/;ta' Is there a way to include both \r\n and \n in one regex to avoid the second substitute script (s/\n\(\)/\1/)? (4 Replies)
Discussion started by: Xterra
4 Replies

10. Shell Programming and Scripting

Regex with sed

hi i would like to say "DATABASENAME=" to "TABLESNAME=" remove "," and press enter myconfig file thanks (1 Reply)
Discussion started by: mnnn
1 Replies
clipf(1)						      General Commands Manual							  clipf(1)

NAME
clipf - Personal finance manager with command line interface SYNOPSYS
clipf [<conf_dir>] DESCRIPTION
Simple personal finance manager, allow to track Your incomes/expences by accounts and hierarchical categories. Store all data in flat text files. ARGUMENTS
<conf_dir> Directory with configuration file and data files. Default to ~/.clipf/. If there is no such directory found at program startup, it would be created and populated by default configuration and empty data files. DEFINITIONS
account - describe independent money storage, for which You want to track remains and turnover. item - describe categories of Your incomes/expences. Can be nested as files/directories in file system. item code - it is segmented unique identifier of item/item group. Period "." in item code define nesting levels. Period at the end of item code describe, that this item is group (have subling items). operation - define single money transaction (income or expense). tag - arbitrary string, used for additional classification of operations. Have the same nesting rules as items. Any number of tags can be added to each operation. It may be good idea to store available tags in item list. USAGE
Type help to see available commands. Type help <command> to see online help about particular <command>. For most reporting commands, output can be piped to external shell command the same way, as shell do. COMMANDS CONCERNING ITEMS
prod add [-d] <item_code> <item_name> Add new item. Type <item_name> in quotes, if it contain spaces. -d - define this item as income (default to expence). prod rm <item_code_prefix> Remove all items, which code starts with <item_code_prefix>. This don't affect the operations list. prod ls [<item_code>] Show one level of item list - direct sublings of <item_code>. Default to root level. prod mv <old_item_code_prefix> <new_item_code_prefix> Update all item codes, which starts with <old_item_code_prefix>, replacing it to <new_item_code_prefix>. Item codes in operation list would be updated as well. COMMANDS CONCERNING OPERATIONS
op add [-d <date>] [-a <account>] [-t <tag>] <item_code> <amount> [<note>] Add new operation -d <date> - override default operation date to <date>. -a <account> - override defaut operation account to <account> -t <tag> - label operation with <tag>. Any number of -t options can be used to add several tags to operation. op ls [-t <tag_prefix>] [<item_code_prefix>] Show list of operations in current reporting period. If <item_code_prefix> specified, list would be limited by the operations, which item code starts with <item_code_prefix>. If '-t <tag_prefix>' option specified, limit output with operations, labelled with tag, starts with <tag_prefix> COMMANDS CONCERNING REPORTING
Reporting period is always between <date_from> and <date_to> global options, which You set by set command. rep prod [-t <tag_prefix>] [-a <account>] [<item_code>] Show turnover report for items (item groups), which are direct subling of <item_code> (default to root). Turnover for item group is summ of turnovers of all their nested items/groups. -t <tag_prefix> take into account only operations, labelled with tag, starts with <tag_prefix> -a <account> take into account only operations by <account> account. rep acc Show remains and turnovers for all accounts. OTHER COMMANDS
set <option> <value> Set global option <option> value to <value>. For date options, base format is Y-M-D. Leading 0 can be ommited. For the current year, year part can be ommited. For current month, year and month parts can be ommited. Available options: date - default date for new operations. Can be overriden by -d option of "op add". date_from date_to - reporting period for "op ls" and all "rep" subcommands. acc - default account for new operations. Can be overriden by -a option of "op add". max_lines - if number of lines in report output exceed this value, then "less" would be used to show report output. show [<option>] Show current values of all global options or specified <option>. calc <expression> Embedded calculator. Evaluate numeric expression and print the result. ALIASES
Aliases is the simple way to make shortcuts for frequently used commands. Alias can be defined by the pair of strings: <command_line_pre- fix> and <prefix_substitution_string>. If command line starts with any of the defined aliases <command_line_prefix>, this prefix would be substituted with corresponding <prefix_substitution_string>. Examples can be found in system configuration file (see FILES ). EXAMPLES
set date_from 2008-04-01 - set reporting start period to 2008-04-01. r prod - show turnover report by top level items. op ls | grep foo | less pipe report output to shell command. op ls | cat - >somefile.txt save report output to file FILES
All configuration files have the same format - plain python code, that would be executed during clipf startup, in the context of main mod- ule. More specific configuration file can overwrite settings from more general one. /etc/clipf.conf system-wide configuration file ~/.clipf.conf user-specific configuration <config_path>/clipf.conf configuration-specific settings. ~/.clipf/ Default configuration directory. Contain clipf.conf configuration file, and db/ subdirectory with data files. AUTHOR
Denis Galtsev <galtsevdv@gmail.com> SEE ALSO
Program site at: http://code.google.com/p/clipf/ clipf(1)
All times are GMT -4. The time now is 08:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy