Sponsored Content
Top Forums Shell Programming and Scripting Wiki conversion with Awk or Sed Post 302421902 by pludi on Monday 17th of May 2010 03:43:05 AM
Old 05-17-2010
Code:
perl -pi.bak -e 's/%ENDCOLOR%/<\/font>/g; s/%(.*?)%/"<font color=\"".lc($1)."\">"/eg' *.twiki

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String Conversion in awk

I am porting a awk script from Windows to unix I_SALE_MEDIA=$67 if ((I_VOID_FLAG == "Y") && (I_SALE_MEDIA == 0)) NOW consider the case where I_SALE_MEDIA i.e $67 is "000" The above comparison works fine in Windows , but to make it work in Unix , I had to change the above as follows : ... (3 Replies)
Discussion started by: rohanrege
3 Replies

2. Shell Programming and Scripting

awk script for date conversion

hi awk script for dd/mm/yyyy to yyyymmdd awk script for dd-mon-yyyy to yyyymmdd awk script for dd-mm-yyyy to yyyymmdd formate ..............urgent............. Thanks in advanced (2 Replies)
Discussion started by: charandevu
2 Replies

3. Shell Programming and Scripting

AWK Currency Conversion

How can I use awk command to convert values to currency. For example I have a database like follows John:200 smith:300 kim:405 and want it to out put like this John $200.00 (3 Replies)
Discussion started by: 3junior
3 Replies

4. Shell Programming and Scripting

File conversion and awk

Hi Everyone, I am confused with the output of the input file and I am using below command in script to get the expected output. Also I want to add another condition using logical AND (&&) in place of $2=="L"{$4=0-$4} as $2=="L" && $3=="L" {$4=0-$4} but I am getting some awk error. Can someone... (6 Replies)
Discussion started by: gehlnar
6 Replies

5. Shell Programming and Scripting

awk string to number conversion

Can someone explain whats happening here: $ awk 'BEGIN {print (2.5 - 1)}' 1,5 2.5 - 1 is correctly calculated to 1,5 (using european locale) $ echo "2.5" | awk '{temp = $1 - 1; print temp}' 1 If i now pipe the string 2.5 through awk it seems at it truncates 2.5 to 2? What's the... (4 Replies)
Discussion started by: beow
4 Replies

6. Shell Programming and Scripting

Most vexing: Sed or Awk scripting for date conversion needed

Hi, I have some files being sent to me that have dates in them in this format: from 1/8/2011 15:14:20 and I need the dates in this format (mysql date format) To 2011-01-08 15:14:20 all I have so far is the regexp that detects the format: sed -r -e 's@\1/\2/\3\4\5\6]::$@do... (7 Replies)
Discussion started by: Astrocloud
7 Replies

7. Shell Programming and Scripting

Conversion of line via awk or etc

Hello friends, could you help me about problem with my data lines. I suppose a simple awk code may help me. I have following data lines: (first line including 3 numbers and then a matrices of 4x10) 500 40 9 1 A B 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22... (6 Replies)
Discussion started by: rpf
6 Replies

8. Shell Programming and Scripting

Decimal conversion number of the form x.xx to 0x.xx, sed?

Hello I have a file of the form ... num 0.12 num num num 25.53 num num num 7.82 num num ...... and I want to convert the 2nd field of each line adding a "0" at the numbers >= 0 and < 10 so the output will have the form: ... num 00.12 num num num 25.53 num num num 07.82 num... (10 Replies)
Discussion started by: phaethon
10 Replies

9. Shell Programming and Scripting

Numeral conversion in awk

I am running into conversion of string to numbers in awk that I can't understand and don't know how to deal with properly My script checks for numeric only field, I use this approach to do that: $1 + 0 == $1 It works most of the time, but in some cases it does not behave how I expect it to... (5 Replies)
Discussion started by: migurus
5 Replies

10. Shell Programming and Scripting

Base64 conversion in awk overlaps

hi, problem: output is not consistent as expected using external command in AWK description: I'm trying to convert $2 into a base64 string for later decoding, and for this when I use awk , I'm getting overlapped results , or say it results are not 100% correct. my code is: gawk... (9 Replies)
Discussion started by: busyboy
9 Replies
Pod::Simple::Wiki(3pm)					User Contributed Perl Documentation				    Pod::Simple::Wiki(3pm)

NAME
Pod::Simple::Wiki - A class for creating Pod to Wiki filters. VERSION
This document refers to version 0.09 of Pod::Simple::Wiki, released May 24 2008. SYNOPSIS
To create a simple filter to convert from Pod to a wiki format: #!/usr/bin/perl -w use strict; use Pod::Simple::Wiki; my $parser = Pod::Simple::Wiki->new('kwiki'); if (defined $ARGV[0]) { open IN, $ARGV[0] or die "Couldn't open $ARGV[0]: $! "; } else { *IN = *STDIN; } if (defined $ARGV[1]) { open OUT, ">$ARGV[1]" or die "Couldn't open $ARGV[1]: $! "; } else { *OUT = *STDOUT; } $parser->output_fh(*OUT); $parser->parse_file(*IN); __END__ To convert Pod to a wiki format using the installed "pod2wiki" utility: pod2wiki --style mediawiki file.pod > file.wiki DESCRIPTION
The "Pod::Simple::Wiki" module is used for converting Pod text to Wiki text. Pod (Plain Old Documentation) is a simple markup language used for writing Perl documentation. A Wiki is a user extensible web site. It uses very simple mark-up that is converted to Html. For an introduction to Wikis see: http://en.wikipedia.org/wiki/Wiki METHODS
new('wiki_format') The "new" method is used to create a new "Pod::Simple::Wiki" object. It is also used to set the output Wiki format. my $parser1 = Pod::Simple::Wiki->new('wiki'); my $parser2 = Pod::Simple::Wiki->new('mediawiki'); my $parser3 = Pod::Simple::Wiki->new(); # Defaults to 'wiki' The currently supported formats are: wiki kwiki usemod twiki tiddlywiki textile wikipedia or mediawiki moinmoin confluence Other methods Pod::Simple::Wiki inherits all of the methods of "Pod::Simple". See Pod::Simple for more details. Supported Formats The following wiki formats are supported by "Pod::Simple::Wiki": wiki This is the original Wiki format as used on Ward Cunningham's Portland repository of Patterns. See http://c2.com/cgi/wiki kwiki This is the format as used by Brian Ingerson's Kwiki: http://www.kwiki.org usemod This is the format used by the Usemod wikis. See: http://www.usemod.com/cgi-bin/wiki.pl twiki This is the format used by TWiki wikis. See: http://twiki.org/ tiddlywiki This is the format used by the TiddlyWiki. See: http://www.tiddlywiki.com/ textile The Textile markup format as used on GitHub. See: http://textile.thresholdstate.com/ wikipedia or mediawiki This is the format used by Wikipedia and MediaWiki wikis. See: http://www.mediawiki.org/ moinmoin This is the format used by MoinMoin wikis. See: http://moinmo.in/MoinMoinWiki confluence This is the format used by Confluence. See: http://www.atlassian.com/software/confluence/ If no format is specified the parser defaults to "wiki". Any other parameters in "new" will be passed on to the parent "Pod::Simple" object. See Pod::Simple for more details. Porting New Wiki Formats If you are interested in porting a new wiki format have a look at Pod::Simple::Wiki::Template. The "Pod::Simple::Wiki" git repository is: http://github.com/jmcnamara/pod-simple-wiki/ SEE ALSO
This module also installs a "pod2wiki" command line utility. See "pod2wiki --help" for details. TODO
o Fix some of the "=over" edge cases. See the TODOs in the test programs. ACKNOWLEDGEMENTS
Thanks to Sean M. Burke for "Pod::Simple". It may not be simple but sub-classing it is. ":-)" Thanks to Sam Tregar for TWiki support. Thanks Tony Sidaway for Wikipedia/MediaWiki support. Thanks to Michael Matthews for MoinMoin support. Thanks to Christopher J. Madsen for several MediaWiki additions and tests. Thanks Tim Bunce for the TiddlyWiki prod and Ron Savage for the port. Thanks to David Bartle, Andrew Hobbs and Jim Renwick for confluence patches. DISCLAIMER OF WARRANTY
Because this software is licensed free of charge, there is no warranty for the software, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the software "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair, or correction. In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the software as permitted by the above licence, be liable to you for damages, including any general, special, incidental, or consequential damages arising out of the use or inability to use the software (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the software to operate with any other software), even if such holder or other party has been advised of the possibility of such damages. LICENSE
Either the Perl Artistic Licence http://dev.perl.org/licenses/artistic.html or the GPL http://www.opensource.org/licenses/gpl-license.php AUTHOR
John McNamara jmcnamara@cpan.org COPYRIGHT
MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. perl v5.10.1 2009-08-29 Pod::Simple::Wiki(3pm)
All times are GMT -4. The time now is 03:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy