11-06-2006
Thank you, that works on the first occurence if i change the 2 at the start to a 1, but it doesnt work on the 2nd occurence if it is left as a 2!
Im not sure why!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I've got a problem with SED. It's my intention to shorten a file path (removing the file name) with the help of SED. Something like:
tmp\folder1\folder2\blah.txt has to be transformed to
tmp\folder1\folder2\.
I suppose, it's on the tip of my tongue. Perhaps it's close to:
sed... (2 Replies)
Discussion started by: sysadv
2 Replies
2. Shell Programming and Scripting
I am obviously missing something here, but the following simple command is giving me problems:
sed 'i\extratext' filename.txt
I receive "sed: command garbled: i\extratext' "
Any suggestions?
Thanks. (6 Replies)
Discussion started by: here2learn
6 Replies
3. UNIX for Dummies Questions & Answers
Hello. Just trying to write this line to an empty file. CAT shows nothing was written. Any suggestions or answers?
#!/bin/bash -x
THIS=FIRSTLINE
sed '1w '$THIS'' testfile
cat testfile
Thank you. (2 Replies)
Discussion started by: steveramsey
2 Replies
4. Shell Programming and Scripting
I have output like the following:
B D 20070116095820001 N D S0000579.LOG S0000582.LOG
B D 20070116095750001 N D S0000574.LOG S0000576.LOG
B D 20070116095734001 N D S0000570.LOG S0000573.LOG
B D 20070116095705001 N D S0000569.LOG S0000569.LOG
B D ... (5 Replies)
Discussion started by: rdudejr
5 Replies
5. Shell Programming and Scripting
Hello Experts,
I am being silly here and just need someone to point out what the silliness is
I have a bunch of lines that are
12343 words here that can chage (hat:98-345) more word and numbers here
I just want to pick out the numbers after "hat:" which is in every line. I have been... (8 Replies)
Discussion started by: gobi
8 Replies
6. Shell Programming and Scripting
I have some troubles with this:
insert (at the beginning of line) character "#" from line 5 to line 15 (3 Replies)
Discussion started by: aspire
3 Replies
7. Shell Programming and Scripting
How do I remove parentheses using sed?
input (192.168.1.1)
output 192.168.1.1 (4 Replies)
Discussion started by: streetfighter2
4 Replies
8. Shell Programming and Scripting
Im usind se as follows,
sed 's/**** DRAFT ****/ /' a.lst > b.lst
'**** DRAFT ****'
in a.lst goes to' ****' in b.lst
Does anyone know the right syntax?
Thanks!!
---------- Post updated at 11:02 AM ---------- Previous update was at 11:00 AM ----------
... (4 Replies)
Discussion started by: ttilsch
4 Replies
9. Shell Programming and Scripting
input1
a_a a/a 10 100
a1 a_a 20 200
b1 b_b 30 300
input2
a_a a/a xxx yyy
a1 a1 lll ppp
b1 b_b kkk ooo
output
a_a a/a 10 100 xxx yyy (2 Replies)
Discussion started by: ruby_sgp
2 Replies
10. UNIX for Beginners Questions & Answers
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies
INSTR(3) MBK UTILITY FUNCTIONS INSTR(3)
NAME
instr - find an occurence of a string in a string, starting at a specified character.
ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in
Paris, France.
Web : http://asim.lip6.fr/recherche/alliance/
E-mail : alliance-users@asim.lip6.fr
SYNOPSYS
#include "mut.h"
char *instr(s, find, from)
char *s, *find, from;
PARAMETERS
s Pointer to the string to be searched for the pattern
find Pointer to the string to be found, the pattern
from Character to be searched backwards before searching for the pattern
DESCRIPTION
instr searches the first occurence of the string find in the string s, starting its search at the last occurence of the from character in
the string s.
If either s or find is NULL, the function returns NULL. If from is (char)0, the pattern is searched from the begining of s.
This quite exotic behaviour is useful to search the occurence of a name in a string resulting from a flatten, when only a terminal object
name is to be taken into account.
RETURN VALUES
instr return NULL either if the pattern find is not present in the searched string s, or if one at least of these two string are NULL. If
the pattern is found, a value different from NULL is returned.
EXAMPLE
#include "mut.h"
/* check for the pattern 'ck' anywhere in the string */
#define contains_ck(name)instr(name, "ck", ' ')
/* check for the pattern 'ck' in the signal name, not instance ones */
#define isclock(ptsig) instr(getsigname(ptsig), "ck", SEPAR)
SEE ALSO
mbk(1), isvdd(3), isvss(3).
BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory.
We need your feedback to improve documentation and tools.
ASIM
/LIP6 October 1, 1997 INSTR(3)