[[HelloInCapitals]] to [[Hello In Capitals]]


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [[HelloInCapitals]] to [[Hello In Capitals]]
Prev   Next
# 1  
Old 10-08-2009
[[HelloInCapitals]] to [[Hello In Capitals]]

Hello community,

I got it all done except for one thing,


[[HelloInCapitals]] or [[PharmaceuticalSocietyOfGreatBritainVBoots1952]]

So now I want to split those in to


[[Hello In Capitals]]

or

[[Pharmaceutical Society Of Great Britain V Boots 1952]]

I am not so good at all this and get stuck with

Code:
sed -e 's/[A-Z]/ &/g' -e 's/[0-9].../ &/g' -e 's/^ //g' infile

But it changes EVERYTHING, and I only want to change Mediawiki links which
are in between [[ ]]

Last edited by Neo; 10-08-2009 at 08:55 AM.. Reason: Please use code tags. Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Directory find in small and capitals

I've a very trivial thing bothering me. I'm rather new in scripting so I'll keep asking stupid questions. Here is small script that does backup of mails. --- for i in `cat /maildir.dir` do echo $i maildir=`echo $i|sed 's@^./usr/@@'` for j in $i/* do && { st="`find $j/backup -name "*"... (3 Replies)
Discussion started by: nitin
3 Replies
Login or Register to Ask a Question
split(1T)						       Tcl Built-In Commands							 split(1T)

__________________________________________________________________________________________________________________________________________________

NAME
split - Split a string into a proper Tcl list SYNOPSIS
split string ?splitChars? _________________________________________________________________ DESCRIPTION
Returns a list created by splitting string at each character that is in the splitChars argument. Each element of the result list will con- sist of the characters from string that lie between instances of the characters in splitChars. Empty list elements will be generated if string contains adjacent characters in splitChars, or if the first or last character of string is in splitChars. If splitChars is an empty string then each character of string becomes a separate element of the result list. SplitChars defaults to the standard white-space char- acters. EXAMPLES
Divide up a USENET group name into its hierarchical components: split "comp.lang.tcl.announce" . => comp lang tcl announce See how the split command splits on every character in splitChars, which can result in information loss if you are not careful: split "alpha beta gamma" "temp" => al {ha b} {} {a ga} {} a Extract the list words from a string that is not a well-formed list: split "Example with {unbalanced brace character" => Example with {unbalanced brace character Split a string into its constituent characters split "Hello world" {} => H e l l o { } w o r l d PARSING RECORD-ORIENTED FILES Parse a Unix /etc/passwd file, which consists of one entry per line, with each line consisting of a colon-separated list of fields: ## Read the file set fid [open /etc/passwd] set content [read $fid] close $fid ## Split into records on newlines set records [split $content " "] ## Iterate over the records foreach rec $records { ## Split into fields on colons set fields [split $rec ":"] ## Assign fields to variables and print some out... lassign $fields userName password uid grp longName homeDir shell puts "$longName uses [file tail $shell] for a login shell" } SEE ALSO
join(1T), list(1T), string(1T) KEYWORDS
list, split, string ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl split(1T)