Sponsored Content
Full Discussion: OFS in awk
Top Forums UNIX for Dummies Questions & Answers OFS in awk Post 302720077 by MIA651 on Tuesday 23rd of October 2012 12:58:21 PM
Old 10-23-2012
Yes, sorry I should've done that from the beginning but here is the output:

Code:
head -5 xtr3.rpl

Outputs:

00530083 0000000471 000000000000.00 000000000000.00
00530085 0000000471 000000000000.00 000000000000.00
00550002 0000000471 000000000000.00 000000000015.00
00550030 0000000471 000000000000.00-000000000007.99
00550034 0000000471 000000000000.00 000000000000.00
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

OFS in awk

Hi, I have these out put field seperator changed to "|" in my awk command, but it didn't give me the result. Can someone help me find out why? ======================================= /bin/awk 'BEGIN { OFS="|" } { print $0 }' list.tmp.$$ > listtmp.$$ =======================================... (1 Reply)
Discussion started by: whatsfordinner
1 Replies

2. Shell Programming and Scripting

OFS in awk.

OFS is inbuild command in awk. I have a file file.txt abc : def : ghi jkl : mno: pqr stu : vwx :yzz code i used: awk -F ":" 'BEGIN {OFS="|"} {print $1,$2}' file.txt output: abc def jkl mno stu vwx but as i have used OFS="|" and i am expecting output as: abc | def jkl... (4 Replies)
Discussion started by: salil2012
4 Replies

3. Shell Programming and Scripting

AWK - OFS

Hi All, I have a comma seperated delimited file with 10 columns. I need to convert it into TAB seperated delimited file. awk -F"," '{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10}' a.txt >> b.txt how to use OFS to get the same output. I have tried by googling, but it... (5 Replies)
Discussion started by: Amit.Sagpariya
5 Replies

4. Shell Programming and Scripting

Parsing XML in awk : OFS does not work as expected

Hi, I am trying to parse regular XML file where I have to reduce number of decimal points in some xml elements. I am using following AWK command to achive that : #!/bin/ksh EDITCMD='BEGIN { FS = ""; OFS=FS } { if ( $3 ~ "*\\.*" && length(substr($3,1+index($3,"."))) == 15 ) {... (4 Replies)
Discussion started by: martin.franek
4 Replies

5. UNIX for Dummies Questions & Answers

Problem with AWK and OFS

I have a file that looks like this: Infile.seq I want to output the DNA sequence and add the filename as the identifier. The output file should look like this: I am using the following code but I do not understand why the sequence is not in the output: awk 'BEGIN { RS =... (11 Replies)
Discussion started by: Xterra
11 Replies

6. Shell Programming and Scripting

Awk OFS issues

Hi Im trying to tidy up the output of a who command when it writes to a log, everything I've tried doesnt seem to work though, any help would be massively appreciated. Im using the awk command to set the OFS as tab. #!/bin/bash who >> /export/home/tjmoore/logusers awk -F 'BEGIN... (3 Replies)
Discussion started by: 02JayJay02
3 Replies

7. Shell Programming and Scripting

Awk OFS issues

Hi, Could anyone tell me what Im doing wrong here any help will be much appreciated #!/bin/bash ls -ltr /export/home/tjmoore > /export/home/tjmoore/log100 awk -F " " /export/home/tjmoore/log100 'BEGIN {OFS="\t";} {print $1,$2,$3,$4,$5, $6,$7,$8,$9;}' > /export/home/tjmoore/log1001 I... (9 Replies)
Discussion started by: 02JayJay02
9 Replies

8. Shell Programming and Scripting

OFS print awk

file: sasa|asasa|asasa|asas erer|Erer|rere|ererer Output needed : sasa:asasa:asasa:asas erer:Erer:rere:ererer Im getting output, when i use the $1,$2. awk -F'|' 'BEGIN{OFS=":";} {print $1,$2; }' file Output : sasa:asasa erer:Erer But when i need the whole column, i... (5 Replies)
Discussion started by: Ramesh M
5 Replies

9. Shell Programming and Scripting

OFS does not apply to few records in awk

Hi , I am having a problem with my awk oneliner , which for some reason leaves the first two records Input File $ cat file1 A1:B1:C1:NoLimit M1:M2:M3:Limit A2:B2:C2,C3,C4,C5 A3:B3:C3,C4,C5,C6,C7Desired output A1,B1,C1,NoLimit M1,M2,M3,Limit A2,B2,C2 ,,,C3 ,,,C4 ,,,C5 A3,B3,C3... (5 Replies)
Discussion started by: chidori
5 Replies

10. Shell Programming and Scripting

awk - OFS printing duplicate. Why?

Why the following code printing duplicate records? bash-4.1$ cat rm1 c1 c2 c3 l1 2 3 4 l2 2 3 2 bash-4.1$ awk '{print $0} OFS = "\n"' rm1 c1 c2 c3 c1 c2 c3 l1 2 3 4 l1 2 3... (4 Replies)
Discussion started by: quincyjones
4 Replies
QAxFactory(3qt) 														   QAxFactory(3qt)

NAME
QAxFactory - Defines a factory for the creation of COM components SYNOPSIS
This class is part of the Qt ActiveQt Extension. #include <qaxfactory.h> Public Members QAxFactory ( const QUuid & libid, const QUuid & appid ) virtual ~QAxFactory () virtual QStringList featureList () const = 0 virtual QWidget * create ( const QString & key, QWidget * parent = 0, const char * name = 0 ) virtual QObject * createObject ( const QString & key, QObject * parent = 0, const char * name = 0 ) virtual QMetaObject * metaObject ( const QString & key ) const virtual bool createObjectWrapper ( QObject * object, IDispatch ** wrapper ) virtual QUuid classID ( const QString & key ) const virtual QUuid interfaceID ( const QString & key ) const virtual QUuid eventsID ( const QString & key ) const virtual QUuid typeLibID () const virtual QUuid appID () const virtual void registerClass ( const QString & key, QSettings * settings ) const virtual void unregisterClass ( const QString & key, QSettings * settings ) const virtual bool validateLicenseKey ( const QString & key, const QString & licenseKey ) const virtual QString exposeToSuperClass ( const QString & key ) const virtual bool stayTopLevel ( const QString & key ) const virtual bool hasStockEvents ( const QString & key ) const virtual bool isService () const enum ServerType { SingleInstance, MultipleInstances } Static Public Members bool isServer () QString serverDirPath () QString serverFilePath () bool startServer ( ServerType type = MultipleInstances ) bool stopServer () DESCRIPTION
This class is defined in the Qt ActiveQt Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API. The QAxFactory class defines a factory for the creation of COM components. Implement this factory once in your ActiveX server to provide information about the components the server can create. If your server supports just a single ActiveX control, you can use the default factory implementation instead of implementing the factory yourself. Use the QAXFACTORY_DEFAULT macro in any implementation file (e.g. main.cpp) to instantiate and export the default factory: #include <qapplication.h> #include <qaxfactory.h> #include "theactivex.h" QAXFACTORY_DEFAULT( TheActiveX, // widget class "{01234567-89AB-CDEF-0123-456789ABCDEF}", // class ID "{01234567-89AB-CDEF-0123-456789ABCDEF}", // interface ID "{01234567-89AB-CDEF-0123-456789ABCDEF}", // event interface ID "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID ) If you implement your own factory reimplement the pure virtual functions, provide the unique identifiers for the ActiveX controls, and use the QAXFACTORY_EXPORT macro to instantiate and export it: QStringList ActiveQtFactory::featureList() const { QStringList list; list << "ActiveX1"; list << "ActiveX2"; ... return list; } QWidget *ActiveQtFactory::create( const QString &key, QWidget *parent, const char *name ) { if ( key == "ActiveX1" ) return new ActiveX1( parent, name ); if ( key == "ActiveX2" ) return new ActiveX2( parent, name ); ... return 0; } QUuid ActiveQtFactory::classID( const QString &key ) const { if ( key == "ActiveX1" ) return "{01234567-89AB-CDEF-0123-456789ABCDEF}"; ... return QUuid(); } QUuid ActiveQtFactory::interfaceID( const QString &key ) const { if ( key == "ActiveX1" ) return "{01234567-89AB-CDEF-0123-456789ABCDEF}"; ... return QUuid(); } QUuid ActiveQtFactory::eventsID( const QString &key ) const { if ( key == "ActiveX1" ) return "{01234567-89AB-CDEF-0123-456789ABCDEF}"; ... return QUuid(); } QAXFACTORY_EXPORT( MyFactory, // factory class "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID ) If you use the Q_CLASSINFO macro to provide the unique identifiers or other attributes for your class you can use the QAXFACTORY_BEGIN, QAXCLASS and QAXFACTORY_END macros to expose one or more classes as COM objects. QAXFACTORY_BEGIN( "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID ) QAXCLASS(Class1) QAXCLASS(Class2) QAXFACTORY_END() Only one QAxFactory implementation may be instantiated and exported by an ActiveX server application. This instance is accessible through the global qAxFactory() function. A factory can also reimplement the registerClass() and unregisterClass() functions to set additional flags for an ActiveX control in the registry. To limit the number of methods or properties a widget class exposes from its parent classes reimplement exposeToSuperClass(). Member Type Documentation QAxFactory::ServerType This enum specifies the different types of servers that can be started with startServer. QAxFactory::SingleInstance - The server can create only one instance of each supplied class. QAxFactory::MultipleInstances - The server can create multiple instances of each supplied class. MEMBER FUNCTION DOCUMENTATION
QAxFactory::QAxFactory ( const QUuid & libid, const QUuid & appid ) Constructs a QAxFactory object that returns libid and appid in the implementation of the respective interface functions. QAxFactory::~QAxFactory () [virtual] Destroys the QAxFactory object. QUuid QAxFactory::appID () const [virtual] Reimplement this function to return the ActiveX server's application identifier. QUuid QAxFactory::classID ( const QString & key ) const [virtual] Reimplement this function to return the class identifier for each key returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of key. The default implementation interprets key as the class name, and returns the value of the Q_CLASSINFO entry "ClassID". QWidget * QAxFactory::create ( const QString & key, QWidget * parent = 0, const char * name = 0 ) [virtual] Reimplement this function to return a new widget for key. Propagate parent and name to the QWidget constructor. Return 0 if this factory doesn't support the value of key. The returned widget will be exposed as an ActiveX control, e.g. a COM object that can be embedded as a control into applications. The default implementation returns 0. QObject * QAxFactory::createObject ( const QString & key, QObject * parent = 0, const char * name = 0 ) [virtual] Reimplement this function to return a new object for key. Propagate parent and name to the QWidget constructor. Return 0 if this factory doesn't support the value of key. If the object returned is a QWidget it will be exposed as an ActiveX control, otherwise the returned object will be exposed as a COM object. The default implementation returns the result QAxFactory::create() if parent is 0 or a widget, otherwise returns 0. bool QAxFactory::createObjectWrapper ( QObject * object, IDispatch ** wrapper ) [virtual] Reimplement this function to provide the COM object for object in wrapper. Return TRUE if the function was successfull, otherwise return FALSE. The default implementation creates a generic automation wrapper based on the meta object information of object. QUuid QAxFactory::eventsID ( const QString & key ) const [virtual] Reimplement this function to return the identifier of the event interface for each key returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of key. The default implementation interprets key as the class name, and returns the value of the Q_CLASSINFO entry "EventsID". QString QAxFactory::exposeToSuperClass ( const QString & key ) const [virtual] Reimplement this function to return the name of the super class of key up to which methods and properties should be exposed by the ActiveX control. The default implementation interprets key as the class name, and returns the value of the Q_CLASSINFO entry "ToSuperClass". If no such value is set the null-string is returned, and the functions and properties of all the super classes including QWidget will be exposed. To only expose the functions and properties of the class itself, reimplement this function to return key. QStringList QAxFactory::featureList () const [pure virtual] Reimplement this function to return a list of the widgets (class names) supported by this factory. bool QAxFactory::hasStockEvents ( const QString & key ) const [virtual] Reimplement this function to return TRUE if the ActiveX control key should support the standard ActiveX events Click DblClick KeyDown KeyPress KeyUp MouseDown MouseUp MouseMove The default implementation interprets key as the class name, and returns TRUE if the value of the Q_CLASSINFO entry "StockEvents" is "yes". Otherwise this function returns FALSE. QUuid QAxFactory::interfaceID ( const QString & key ) const [virtual] Reimplement this function to return the interface identifier for each key returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of key. The default implementation interprets key as the class name, and returns the value of the Q_CLASSINFO entry "InterfaceID". bool QAxFactory::isServer () [static] Returns TRUE if the application has been started (by COM) as an ActiveX server, otherwise returns FALSE. int main( int argc, char**argv ) { QApplication app( argc, argv ); if ( !QAxFactory::isServer() ) { // initialize for stand-alone execution } return app.exec() // standard event processing } bool QAxFactory::isService () const [virtual] Reimplement this function to return TRUE if the server is running as a persistent service (e.g. an NT service) and should not terminate even when all objects provided have been released. The default implementation returns FALSE. QMetaObject * QAxFactory::metaObject ( const QString & key ) const [virtual] Reimplement this function to return the QMetaObject corresponding to key, or 0 if this factory doesn't support the value of key. The default implementation returns the QMetaObject for the class key. void QAxFactory::registerClass ( const QString & key, QSettings * settings ) const [virtual] Registers additional values for the class key in the system registry using the settings object. The standard values have already been registed by the framework, but additional values, e.g. implemented categories, can be added in an implementation of this function. settings->writeEntry( "/CLSID/" + classID(key) + "/Implemented Categories/{00000000-0000-0000-000000000000}/.", QString::null ); If you reimplement this function you must also reimplement unregisterClass() to remove the additional registry values. See also QSettings. QString QAxFactory::serverDirPath () [static] Returns the directory that contains the server binary. For out-of-process servers this is the same as QApplication::applicationDirPath(). For in-process servers that function returns the directory that contains the hosting application. QString QAxFactory::serverFilePath () [static] Returns the file path of the server binary. For out-of-process servers this is the same as QApplication::applicationFilePath(). For in-process servers that function returns the file path of the hosting application. bool QAxFactory::startServer ( ServerType type = MultipleInstances ) [static] Starts the COM server with type and returns TRUE if successful, otherwise returns FALSE. Calling this function if the server is already running (or for an in-process server) does nothing and returns TRUE. The server is started automatically with type set to MultipleUse if the server executable has been started with the -activex command line parameter. bool QAxFactory::stayTopLevel ( const QString & key ) const [virtual] Reimplement this function to return TRUE if the ActiveX control key should be a top level window, e.g. a dialog. The default implementation returns FALSE. bool QAxFactory::stopServer () [static] Stops the COM server and returns TRUE if successful, otherwise returns FALSE. Calling this function if the server is not running (or for an in-process server) does nothing and returns TRUE. Stopping the server will not invalidate existing objects, but no new objects can be created from the existing server process. Usually COM will start a new server process if additional objects are requested. The server is stopped automatically when the main() function returns. QUuid QAxFactory::typeLibID () const [virtual] Reimplement this function to return the ActiveX server's type library identifier. void QAxFactory::unregisterClass ( const QString & key, QSettings * settings ) const [virtual] Unregisters any additional values for the class key from the system registry using the settings object. settings->removeEntry( "/CLSID/" + classID(key) + "/Implemented Categories/{00000000-0000-0000-000000000000}/." ); See also registerClass() and QSettings. bool QAxFactory::validateLicenseKey ( const QString & key, const QString & licenseKey ) const [virtual] Reimplement this function to return TRUE if licenseKey is a valid license for the class key, or if the current machine is licensed. The default implementation returns TRUE if the class key is not licensed (ie. no Q_CLASSINFO attribute "LicenseKey"), or if licenseKey matches the value of the "LicenseKey" attribute, or if the machine is licensed through a .LIC file with the same filename as this COM server. SEE ALSO
http://doc.trolltech.com/qaxfactory.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 (qaxfactory.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QAxFactory(3qt)
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy