Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Regular Expressions -- Find spaces outside Post 302449164 by Scott on Saturday 28th of August 2010 07:29:41 PM
Old 08-28-2010
Hi.

Would this work?

Code:
$ awk -F"(" -v OFS="(" 'gsub(/ +/, "\t", $1)' file1
意文	yìwén	(given name)
貴姓	guìxìng	(honorable surname)
貴	guì	(honorable)
姓	xìng	(one's surname is; to be surnamed; surname)
呢	ne	(interrogative particle)
叫	jiào	(to be called; to call)
名字	míngzi	(name)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular Expressions

I'm trying to parse RichText to XML. I want to be able to capture everything between the '/par' tag in the RTF but not include the tag itself. So far all I have is this, '.*?\\par' but it leaves '\par' at the end of it. Any suggestions? (1 Reply)
Discussion started by: AresMedia
1 Replies

2. Shell Programming and Scripting

Regular Expressions

How can i create a regular expression which can detect a new line charcter followed by a special character say * and replace these both by a string of zero length? Eg: Input File san.txt hello hi ... (6 Replies)
Discussion started by: sandeep_hi
6 Replies

3. Shell Programming and Scripting

regular expressions

Hi, can anyone advise me how to shorten this: if || ; then I tried but it dosent seem to work, whats the correct way. Cheers (4 Replies)
Discussion started by: jack1981
4 Replies

4. UNIX for Dummies Questions & Answers

regular expressions

Hi Gurus, I need help with regular expressions. I want to create a regular expression which will take only alpha-numeric characters for 7 characters long and will throw out an error if longer than that. i tried various combinations but couldn't get it, please help me how to get it guys. ... (2 Replies)
Discussion started by: ragha81
2 Replies

5. UNIX for Dummies Questions & Answers

regular expressions

how to find for a file whose name has all characters in uppercase after 'project'? I tried this: find . -name 'project**.pdf' ./projectABC.pdf ./projectABC123.pdf I want only ./projectABC.pdf What is the regular expression that correponds to "all characters are capital"? thanks (8 Replies)
Discussion started by: melanie_pfefer
8 Replies

6. Shell Programming and Scripting

Need help with Regular Expressions

Hi, In ksh, I am trying to compare folder names having -141- in it's name. e.g.: 4567-141-8098 should match this expression '*-141-*' but, -141-2354 should fail when compared with '*-141-*' simlarly, abc should fail when compared with '*-141-*' I tried multiple things but nevertheless,... (5 Replies)
Discussion started by: jidsh
5 Replies

7. Shell Programming and Scripting

Regular Expressions

what elements does " /^/ " match? I did the test which indicates that it matches single lowercase character like 'a','b' etc. and '1','2' etc. But I really confused with that. Because, "/^abc/" matches strings like "abcedf" or "abcddddee". So, what does caret ^ really mean? Any response... (2 Replies)
Discussion started by: DavidHe
2 Replies

8. Shell Programming and Scripting

Help with regular expressions

I have a file that I'm trying to find all the cases of phone number extensions and deleting them. So input file looks like: abc x93825 def 13234 x52673 hello output looks like: abc def 13234 hello Basically delete lines that have 5 numbers following "x". I tried: x\(4) but it... (7 Replies)
Discussion started by: pxalpine
7 Replies

9. UNIX for Advanced & Expert Users

Using find and regular expressions

Hi Could you please advise how can one extract from the output of find . -name "*.c" -print only filenames in the current direcotry and not in its subdirectories? I tried using (on Linux x86_64) find . -name "*.c" -prune but it is not giving correct output. Whereas I am getting... (9 Replies)
Discussion started by: tinku981
9 Replies

10. Shell Programming and Scripting

Replacing Multiple spaces with a single space but excluding few regular expressions

Hi All. Attached are two files. I ran a query and have the output as in the file with name "FILEWITHFOURRECORDS.txt " I didn't want all the spaces between the columns so I squeezed the spaces with the "tr" command and also added a carriage return at the end of every line. But in two... (3 Replies)
Discussion started by: sparks
3 Replies
QAsciiDictIterator(3qt) 												   QAsciiDictIterator(3qt)

NAME
QAsciiDictIterator - Iterator for QAsciiDict collections SYNOPSIS
#include <qasciidict.h> Public Members QAsciiDictIterator ( const QAsciiDict<type> & dict ) ~QAsciiDictIterator () uint count () const bool isEmpty () const type * toFirst () operator type * () const type * current () const const char * currentKey () const type * operator() () type * operator++ () type * operator+= ( uint jump ) DESCRIPTION
The QAsciiDictIterator class provides an iterator for QAsciiDict collections. QAsciiDictIterator is implemented as a template class. Define a template instance QAsciiDictIterator<X> to create a dictionary iterator that operates on QAsciiDict<X> (dictionary of X*). Example: QAsciiDict<QLineEdit> fields; fields.insert( "forename", new QLineEdit( this ) ); fields.insert( "surname", new QLineEdit( this ) ); fields.insert( "age", new QLineEdit( this ) ); fields["forename"]->setText( "Homer" ); fields["surname"]->setText( "Simpson" ); fields["age"]->setText( "45" ); QAsciiDictIterator<QLineEdit> it( fields ); for( ; it.current(); ++it ) cout << it.currentKey() << ": " << it.current()->text() << endl; cout << endl; // Output (random order): // age: 45 // surname: Simpson // forename: Homer In the example we insert some line edits into a dictionary, then iterate over the dictionary printing the strings associated with those line edits. Note that the traversal order is arbitrary; you are not guaranteed any particular order. Multiple iterators may independently traverse the same dictionary. A QAsciiDict knows about all the iterators that are operating on the dictionary. When an item is removed from the dictionary, QAsciiDict updates all the iterators that are referring to the removed item to point to the next item in the (arbitrary) traversal order. See also QAsciiDict, Collection Classes, and Non-GUI Classes. MEMBER FUNCTION DOCUMENTATION
QAsciiDictIterator::QAsciiDictIterator ( const QAsciiDict<type> & dict ) Constructs an iterator for dict. The current iterator item is set to point on the first item in the dict. QAsciiDictIterator::~QAsciiDictIterator () Destroys the iterator. uint QAsciiDictIterator::count () const Returns the number of items in the dictionary this iterator operates over. See also isEmpty(). type * QAsciiDictIterator::current () const Returns a pointer to the current iterator item. const char * QAsciiDictIterator::currentKey () const Returns a pointer to the key for the current iterator item. bool QAsciiDictIterator::isEmpty () const Returns TRUE if the dictionary is empty, i.e. count() == 0, otherwise returns FALSE. See also count(). QAsciiDictIterator::operator type * () const Cast operator. Returns a pointer to the current iterator item. Same as current(). type * QAsciiDictIterator::operator() () Makes the succeeding item current and returns the original current item. If the current iterator item was the last item in the dictionary or if it was 0, 0 is returned. type * QAsciiDictIterator::operator++ () Prefix ++ makes the succeeding item current and returns the new current item. If the current iterator item was the last item in the dictionary or if it was 0, 0 is returned. type * QAsciiDictIterator::operator+= ( uint jump ) Sets the current item to the item jump positions after the current item, and returns a pointer to that item. If that item is beyond the last item or if the dictionary is empty, it sets the current item to 0 and returns 0. type * QAsciiDictIterator::toFirst () Sets the current iterator item to point to the first item in the dictionary and returns a pointer to the item. If the dictionary is empty it sets the current item to 0 and returns 0. SEE ALSO
http://doc.trolltech.com/qasciidictiterator.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qasciidictiterator.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QAsciiDictIterator(3qt)
All times are GMT -4. The time now is 02:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy