Search Results

Search: Posts Made By: pioavi
1,840
Posted By rdrtx1
try: awk ' {l=l ":lb:" $0; if ($0 ~ /< *\/...
try:
awk '
{l=l ":lb:" $0;
if ($0 ~ /< *\/ *section>/) {
sub("^:lb:","",l); sub("^:lb:","",l); sub("^:lb:","",l);
if (l ~ /ole[-]present/) gsub(":lb:","",l);
gsub(":lb:","\n",l);
...
1,912
Posted By rangarasan
sed
Hi,

If you need your code to be more generic, Try this one,

Input:


<li>keyword</li>
<a>keyword
<B>keyword</B>
<li>keyword
<li>keyword</li>



sed '/>$/!...
1,912
Posted By michaelrozar17
Here you go.. [mkt@michael]$ sed '/^<li>/{ >...
Here you go..
[mkt@michael]$ sed '/^<li>/{
> />$/!s/$/<\/li>/
> }' inputfile
...
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
...
[mkt@michael]$...
1,912
Posted By bartus11
Does it have to be sed?awk...
Does it have to be sed?awk '/^<li>/&&!/<\/li>$/{$0=$0"</li>"}1' file
1,588
Posted By birei
Hi pioavi, Why awk? In my opinion, it's not...
Hi pioavi,

Why awk? In my opinion, it's not the tool for the job. I would use xpath, xquery or xslt instead, but here you have a script (probably needed the GNU version). Test it:

$ cat infile...
2,202
Posted By vgersh99
something to start with - assuming...
something to start with - assuming 'numitem_tabN[]' and 'subitem_tabN[]' all precede the <record> definitions):

nawk -F'[=:]' '$1~/^(sub|num)item_tab[0-9][0-9]*[[]] */ {item[" "$1]=$2;next}...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 03:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy