Sponsored Content
Top Forums Shell Programming and Scripting How to change comma delimeter in the file to number? Post 303019222 by Don Cragun on Monday 25th of June 2018 09:51:45 AM
Old 06-25-2018
The code that I suggested in post #4 in this thread works exactly as you requested on a MacBook Pro running the same operating system that you are running on your iMac and you should have the same utilities on your iMac. I have absolutely no idea why it is working for me and fails for you if you copied the code I suggested without modifying it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to change a number in a file with sed?

Hello, I have a file which contains some line as follows, 9.9 TEMP 9.9 MUCOEFF 0.0 EPSILON And I want to increase this MUCOEFF by 0.2 as 9.9 TEMP 10.1 MUCOEFF 0.0 ... (7 Replies)
Discussion started by: lorenzz
7 Replies

2. Shell Programming and Scripting

Count the delimeter from a file and delete the row if delimeter count doesnt match.

I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Discussion started by: Akumar1
5 Replies

3. Shell Programming and Scripting

Change the File name using pattern and number

Hi, i have the below files in the wrk folder. File names are AAB0001.R BBA0002.R CCDC0003.R AAB0002.R AAB0034.R BBA0081.R DDDE0008.R i need to change the file name USING pattern and number. output like below :wall: AAB0001.R AAB0002.R AAB0003.R BBA0001.R BBA0002.R CCDC0001.R... (3 Replies)
Discussion started by: krbala1985
3 Replies

4. Shell Programming and Scripting

Count number of column in a comma delimited file

I have a comma (,) delimited file. 106232145,"medicare","medicare,medicaid",789 I would like to count the number of fields in each line. I tried the below code awk -F ',' '{print NF-1}' This returns me the result as 5 instead of 4. This is because the awk takes... (9 Replies)
Discussion started by: machomaddy
9 Replies

5. Shell Programming and Scripting

Needed value after the last delimeter in a file with varying number of delimited columns

Hi All, My file has the records as below: aaa\bbb\c\dd\ee\ff\gg zz\vv\ww pp\oo\ii\uu How can I get the value after the last delimeter. My o/p: gg ww uu Thanks in Advance, (5 Replies)
Discussion started by: HemaV
5 Replies

6. Shell Programming and Scripting

Print records which do not have expected number of fields in a comma delimited file

Hi, I have a comma (,) delimited file, in which few fields are enclosed with in double quotes " ". I have to print the records in the file which donot have expected number of field with the line number. File1 ==== name,desgnation,doj,project #header#... (7 Replies)
Discussion started by: machomaddy
7 Replies

7. Shell Programming and Scripting

missing comma delimeter in columns

hi if comma delimeter missing in columns treat them as bad file and if it is not then gudfiles. only checking columns not data. id,name,sal,deptno =======> gudfile 1,awa,200,10 2,aba,100,20 3,cdc,300,30 idname,sal,deptno ========> badfile since its missing (.)... (8 Replies)
Discussion started by: awais290
8 Replies

8. Shell Programming and Scripting

How to change a number on a specific lines in a file with shell?

Hello My problem is that I want to change some specific numbers in a file. It is like, 2009 10 3 2349 21.3 L 40.719 27.388 10.8 FRO 7 0.8 1.1LFRO 2.6CFRO 1.1LMAM1 GAP=157 1.69 5.7 5.9 5.8 0.5405E+01 0.4455E+00 0.1653E+02E STAT SP IPHASW D HRMM SECON CODA AMPLIT... (11 Replies)
Discussion started by: miriammiriam
11 Replies

9. Shell Programming and Scripting

Replace comma and blank with comma and number

I, I have a file and i need to replace comma and blank space with comma and 0. cat file.txt a,5 b,1 c, d, e,4 I need the output as cat file.txt a,5 b,1 c,0 d,0 (4 Replies)
Discussion started by: jaituteja
4 Replies

10. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies
QThread(3qt)															      QThread(3qt)

NAME
QThread - Platform-independent threads SYNOPSIS
All the functions in this class are thread-safe when Qt is built with thread support.</p> #include <qthread.h> Inherits Qt. Public Members QThread () QThread ( unsigned int stackSize ) virtual ~QThread () bool wait ( unsigned long time = ULONG_MAX ) void start () void terminate () bool finished () const bool running () const Static Public Members Qt::HANDLE currentThread () void postEvent ( QObject * receiver, QEvent * event ) (obsolete) void exit () Protected Members virtual void run () = 0 Static Protected Members void sleep ( unsigned long secs ) void msleep ( unsigned long msecs ) void usleep ( unsigned long usecs ) DESCRIPTION
The QThread class provides platform-independent threads. A QThread represents a separate thread of control within the program; it shares data with all the other threads within the process but executes independently in the way that a separate program does on a multitasking operating system. Instead of starting in main(), QThreads begin executing in run(). You inherit run() to include your code. For example: class MyThread : public QThread { public: virtual void run(); }; void MyThread::run() { for( int count = 0; count < 20; count++ ) { sleep( 1 ); qDebug( "Ping!" ); } } int main() { MyThread a; MyThread b; a.start(); b.start(); a.wait(); b.wait(); } This will start two threads, each of which writes Ping! 20 times to the screen and exits. The wait() calls at the end of main() are necessary because exiting main() ends the program, unceremoniously killing all other threads. Each MyThread stops executing when it reaches the end of MyThread::run(), just as an application does when it leaves main(). See also Thread Support in Qt, Environment Classes, and Threading. MEMBER FUNCTION DOCUMENTATION
QThread::QThread () Constructs a new thread. The thread does not begin executing until start() is called. QThread::QThread ( unsigned int stackSize ) Constructs a new thread. The thread does not begin executing until start() is called. If stackSize is greater than zero, the maximum stack size is set to stackSize bytes, otherwise the maximum stack size is automatically determined by the operating system. Warning: Most operating systems place minimum and maximum limits on thread stack sizes. The thread will fail to start if the stack size is outside these limits. QThread::~QThread () [virtual] QThread destructor. Note that deleting a QThread object will not stop the execution of the thread it represents. Deleting a running QThread (i.e. finished() returns FALSE) will probably result in a program crash. You can wait() on a thread to make sure that it has finished. Qt::HANDLE QThread::currentThread () [static] This returns the thread handle of the currently executing thread. Warning: The handle returned by this function is used for internal purposes and should not be used in any application code. On Windows, the returned value is a pseudo handle for the current thread, and it cannot be used for numerical comparison. void QThread::exit () [static] Ends the execution of the calling thread and wakes up any threads waiting for its termination. bool QThread::finished () const Returns TRUE is the thread is finished; otherwise returns FALSE. void QThread::msleep ( unsigned long msecs ) [static protected] System independent sleep. This causes the current thread to sleep for msecs milliseconds void QThread::postEvent ( QObject * receiver, QEvent * event ) [static] This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. Use QApplication::postEvent() instead. void QThread::run () [pure virtual protected] This method is pure virtual, and must be implemented in derived classes in order to do useful work. Returning from this method will end the execution of the thread. See also wait(). bool QThread::running () const Returns TRUE if the thread is running; otherwise returns FALSE. void QThread::sleep ( unsigned long secs ) [static protected] System independent sleep. This causes the current thread to sleep for secs seconds. void QThread::start () This begins the execution of the thread by calling run(), which should be reimplemented in a QThread subclass to contain your code. If you try to start a thread that is already running, this call will wait until the thread has finished, and then restart the thread. void QThread::terminate () This function terminates the execution of the thread. The thread may or may not be terminated immediately, depending on the operating systems scheduling policies. Use QThread::wait() after terminate() for synchronous termination. When the thread is terminated, all threads waiting for the the thread to finish will be woken up. Warning: This function is dangerous, and its use is discouraged. The thread can be terminate at any point in its code path. Threads can be terminated while modifying data. There is no chance for the thread to cleanup after itself, unlock any held mutexes, etc. In short, use this function only if absolutely necessary. void QThread::usleep ( unsigned long usecs ) [static protected] System independent sleep. This causes the current thread to sleep for usecs microseconds bool QThread::wait ( unsigned long time = ULONG_MAX ) This provides similar functionality to POSIX pthread_join. A thread calling this will block until either of these conditions is met: The thread associated with this QThread object has finished execution (i.e. when it returns from run()). This function will return TRUE if the thread has finished. It also returns TRUE if the thread has not been started yet. time milliseconds has elapsed. If time is ULONG_MAX (the default), then the wait will never timeout (the thread must return from run()). This function will return FALSE if the wait timed out. SEE ALSO
http://doc.trolltech.com/qthread.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, 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 (qthread.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QThread(3qt)
All times are GMT -4. The time now is 01:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy