Sponsored Content
Top Forums Shell Programming and Scripting Converting Tab delimited file to Comma delimited file in Unix Post 96153 by charan81 on Wednesday 18th of January 2006 06:28:08 AM
Old 01-18-2006
Vino..No Luck..

Let me tell u my requirement..

I have a file dmlog.txt with data like this

LOAD_STAGE STAGE_LOAD COMPLETE U0 10-OCT-05
LOAD_STAGE_A D_CA_PRODUCT COMPLETE U0 10-OCT-05
LOAD_STAGE_B D_CB_PRODUCT COMPLETE U0 10-OCT-05

Now i need to convert it to

LOAD_STAGE,STAGE_LOAD,COMPLETE,U0,10-OCT-05
LOAD_STAGE_A,D_CA_PRODUCT,COMPLETE,U0,10-OCT-05
LOAD_STAGE_B,D_CB_PRODUCT,COMPLETE,U0,10-OCT-05

Can u explain me on how to proceed with this Example.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Converting Space delimited file to Tab delimited file

Hi all, I have a file with single white space delimited values, I want to convert them to a tab delimited file. I tried sed, tr ... but nothing is working. Thanks, Rajeevan D (16 Replies)
Discussion started by: jeevs81
16 Replies

2. Shell Programming and Scripting

Retrieving values from tab-delimited file in unix script

Hi I am trying to retrieve values from a tab-delimited file.I am using while read record value=`echo $record | cut -f12` done Where 12 is the column no i want retieve and record is one line of the file. But it is returning the full record. Plz help (4 Replies)
Discussion started by: akashtcs
4 Replies

3. Shell Programming and Scripting

Converting comma separated to pipe delimited file

Hi, I came across a very good script to convert a comma seperated to pipe delimited file in this forum. the script serves most of the requirement but looks like it does not handle embedded double quotes and commas i.e if the input is like 1234, "value","first,second", "LDC5"monitor",... (15 Replies)
Discussion started by: anijan
15 Replies

4. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

5. Shell Programming and Scripting

how to convert comma delimited file to tab separator

Hi all, How can i convert comma delimited .csv file to tab separate using sed command or script. Thanks, Krupa (4 Replies)
Discussion started by: krupasindhu18
4 Replies

6. Shell Programming and Scripting

How to make tab delimited file to space delimited?

Hi How to make tab delimited file to space delimited? in put file: ABC kgy jkh ghj ash kjl o/p file: ABC kgy jkh ghj ash kjl Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies

7. UNIX for Dummies Questions & Answers

Need help with tab delimited file in unix

Hi, I need urgent help with a tab delimited file I am working on. This is the file : TTTT|YYYYYYY|jargon-journal|MP0000000UID||"j1, j2, j3" I need th following output: TTTT|YYYYYYY|jargon-journal|MP0000000UID||ji TTTT|YYYYYYY|jargon-journal|MP0000000UID||j2... (8 Replies)
Discussion started by: rayarnab
8 Replies

8. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies

9. Shell Programming and Scripting

Help/Advise please for converting space delimited string variable to comma delimited with quote

Hi, I am wanting to create a script that will construct a SQL statement based on a a space delimited string that it read from a config file. Example of the SQL will be For example, it will read a string like "AAA BBB CCC" and assign to a variable named IN_STRING. I then concatenate... (2 Replies)
Discussion started by: newbie_01
2 Replies

10. UNIX for Beginners Questions & Answers

Replace a column in tab delimited file with column in other tab delimited file,based on match

Hello Everyone.. I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files FileP.txt ... (2 Replies)
Discussion started by: YogeshG
2 Replies
MPI_Grequest_start(3OpenMPI)											      MPI_Grequest_start(3OpenMPI)

NAME
MPI_Grequest_start - Starts a generalized request and returns a handle to it in request. SYNTAX
C Syntax #include <mpi.h> int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request) Fortran Syntax (see FORTRAN 77 NOTES) INCLUDE 'mpif.h' MPI_GREQUEST_START(QUERY_FN, FREE_FN, CANCEL_FN, EXTRA_STATE, REQUEST, IERROR) INTEGER REQUEST, IERROR EXTERNAL QUERY_FN, FREE_FN, CANCEL_FN INTEGER (KIND=MPI_ADDRESS_KIND) EXTRA_STATE C++ Syntax #include <mpi.h> static MPI::Grequest MPI::Grequest::Start(const MPI::Grequest::Query_function query_fn, const MPI::Grequest::Free_function free_fn, const MPI::Grequest::Cancel_function cancel_fn, void *extra_state) INPUT PARAMETERS
query_fn Callback function invoked when request status is queried (function). free_fn Callback function invoked when request is freed (function). cancel_fn Callback function invoked when request is canceled (function). extra_state Extra state. OUTPUT PARAMETERS
request Generalized request (handle). IERROR Fortran only: Error status (integer). DESCRIPTION
MPI_Grequest_start starts a generalized request and returns a handle to it in request. The syntax and meaning of the callback functions are listed below. All callback functions are passed the extra_state argument that was associated with the request by the starting call MPI_Grequest_start. This can be used to maintain user-defined state for the request. In C, the query function is typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status); In Fortran, it is SUBROUTINE GREQUEST_QUERY_FUNCTION(EXTRA_STATE, STATUS, IERROR) INTEGER STATUS(MPI_STATUS_SIZE), IERROR INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE and in C++, it is typedef int MPI::Grequest::Query_function(void* extra_state, MPI::Status& status); The query_fn function computes the status that should be returned for the generalized request. The status also includes information about successful/unsuccessful cancellation of the request (result to be returned by MPI_Test_cancelled). The query_fn function is invoked by the MPI_{Wait|Test}{any|some|all} call that completed the generalized request associated with this callback. The callback function is also invoked by calls to MPI_Request_get_status if the request is complete when the call occurs. In both cases, the callback is passed a reference to the corresponding status variable passed by the user to the MPI call. If the user provided MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE to the MPI function that causes query_fn to be called, then MPI will pass a valid status object to query_fn, and this status will be ignored upon return of the callback function. Note that query_fn is invoked only after MPI_Grequest_com- plete is called on the request; it may be invoked several times for the same generalized request. Note also that a call to MPI_{Wait|Test}{some|all} may cause multiple invocations of query_fn callback functions, one for each generalized request that is completed by the MPI call. The order of these invocations is not specified by MPI. In C, the free function is typedef int MPI_Grequest_free_function(void *extra_state); In Fortran, it is SUBROUTINE GREQUEST_FREE_FUNCTION(EXTRA_STATE, IERROR) INTEGER IERROR INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE And in C++, it is typedef int MPI::Grequest::Free_function(void* extra_state); The free_fn callback function is invoked to clean up user-allocated resources when the generalized request is freed. The free_fn function is invoked by the MPI_{Wait|Test}{any|some|all} call that completed the generalized request associated with this call- back. free_fn is invoked after the call to query_fn for the same request. However, if the MPI call completed multiple generalized requests, the order in which free_fn callback functions are invoked is not specified by MPI. The free_fn callback is also invoked for generalized requests that are freed by a call to MPI_Request_free (no call to MPI_{Wait|Test}{any|some|all} will occur for such a request). In this case, the callback function will be called either in the MPI call MPI_Request_free(request) or in the MPI call MPI_Grequest_complete(request), whichever happens last. In other words, in this case the actual freeing code is executed as soon as both calls (MPI_Request_free and MPI_Grequest_complete) have occurred. The request is not deal- located until after free_fn completes. Note that free_fn will be invoked only once per request by a correct program. In C, the cancel function is typedef int MPI_Grequest_cancel_function(void *extra_state, int complete); In Fortran, the cancel function is SUBROUTINE GREQUEST_CANCEL_FUNCTION(EXTRA_STATE, COMPLETE, IERROR) INTEGER IERROR INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE LOGICAL COMPLETE In C++, the cancel function is typedef in MPI::Grequest::Cancel_function(void* extra_state, bool complete); The cancel_fn function is invoked to start the cancelation of a generalized request. It is called by MPI_Request_cancel(request). MPI passes to the callback function complete=true if MPI_Grequest_complete has already been called on the request, and complete=false other- wise. FORTRAN 77 NOTES The MPI standard prescribes portable Fortran syntax for the EXTRA_STATE argument only for Fortran 90. FORTRAN 77 users may use the non- portable syntax INTEGER*MPI_ADDRESS_KIND EXTRA_STATE where MPI_ADDRESS_KIND is a constant defined in mpif.h and gives the length of the declared integer in bytes. ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. All callback functions return an error code. The code is passed back and dealt with as appropriate for the error code by the MPI function that invoked the callback function. For example, if error codes are returned, then the error code returned by the callback function will be returned by the MPI function that invoked the callback function. In the case of a MPI_{Wait|Test}any call that invokes both query_fn and free_fn, the MPI call will return the error code returned by the last callback, namely free_fn. If one or more of the requests in a call to MPI_{Wait|Test}{some|all} has failed, then the MPI call will return MPI_ERR_IN_STATUS. In such a case, if the MPI call was passed an array of statuses, then MPI will return in each of the statuses that correspond to a completed generalized request the error code returned by the corresponding invocation of its free_fn callback function. However, if the MPI function was passed MPI_STATUSES_IGNORE, then the individual error codes returned by each callback function will be lost. See the MPI man page for a full list of MPI error codes. Open MPI 1.2 September 2006 MPI_Grequest_start(3OpenMPI)
All times are GMT -4. The time now is 05:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy