Sponsored Content
Top Forums Shell Programming and Scripting Remove the leading and trailing date from a CSV file Post 303000510 by shivamayam on Thursday 13th of July 2017 12:12:54 PM
Old 07-13-2017
Thank you jgt.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Leading and Trailing Spaces

Hi, how to i remove leading and trailing spaces from a line? the spaces can be behind or in front of any field or line example of a line in the input data: Amy Reds , 100 , /bin/sh how to i get it to be: Amy Read,100,/bin/sh i saw something on this on the Man pages for AWK... (7 Replies)
Discussion started by: sleepster
7 Replies

2. UNIX for Dummies Questions & Answers

Removing leading and trailing spaces of data between the tags in xml.

I am having xml document as below. <transactionid> 00 </transactionid> <tracknumber> 0 </tracknumber> <key> N/A </key> But the data contains leading and trailing spaces between the tags. Please let me know how can i remove these leading and trailing spaces between the tags.... (2 Replies)
Discussion started by: jhmr7
2 Replies

3. Shell Programming and Scripting

remove trailing and leading spaces using tr command

Dear All, can you please advice how do i remove trailing and leading spaces from a pipe-delimited file using "tr" command the below cmd, i tried removed all spaces tr -d ' '<s1.txt>s2.txt1 Many thx Suresh (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

4. Shell Programming and Scripting

Removing leading and trailing spaces only in PERL

Hi All, I have a file with the following contents with multiple lines 172445957| 000005911|8| 400 Peninsula Ave.#1551 | And,K |935172445957|000005911 607573888 |000098536 | 2|Ane, B |J |Ane |1868 |19861206|20090106|20071001 I want to trim the "leading and trailing spaces only" from... (2 Replies)
Discussion started by: kumar04
2 Replies

5. Shell Programming and Scripting

Remove trailing spaces from file

I'm currently writing my sql results to a file and they have trailing spaces after each field. I want to get rid of these spaces and I'm using this code: TVXTEMP=$(echo $TVXTEMP|sed -e 's/\ //g') It doesn't work though. I'm not familiar with sedscript, and the other codes I've found online... (6 Replies)
Discussion started by: avillanueva
6 Replies

6. Shell Programming and Scripting

Help to move leading negative sign to trailing position

Hi All, I am having a file which contains negative numbers, wht i am doing is re-formattting the file(moving few columns and add few hard codings between), while reformatting i would want the negative numbers to have the sign as trailing rather than leading. Existing -2400.00 34 0.00... (11 Replies)
Discussion started by: selvankj
11 Replies

7. Shell Programming and Scripting

Clearing leading and trailing blanks from a string in C Shell

Does anyone know of a way with C Shell that will work on both Linux and Sun to clear all leading and trailing blanks from a previously specified string? I am using the following code to replace blanks with underscores: set Company = `echo $Company | sed 's/ /_/g but I don't want any... (1 Reply)
Discussion started by: phudgens
1 Replies

8. Shell Programming and Scripting

Ho to remove leading zeros from a csv file which is sent from a UNIX script

Hi All, I am using a informatica job to create a csv file and a unix script the mail the generated file.Everything is working fine but I am not seeing leading zeros in the csv file sent in the mail.These zeros were present when the .csv file was generated by informatica procees. Is there any... (11 Replies)
Discussion started by: karthik adiga
11 Replies

9. Shell Programming and Scripting

Remove leading and trailing spaces from a file

Hi, I am trying to remove leading and trailing spaces from a file using awk but somehow I have not been able to do it. Here is the data that I want to trim. 07/12/2017 15:55:00 |entinfdev |AD ping Time ms | .474| 1.41| .581|green |flat... (9 Replies)
Discussion started by: svajhala
9 Replies

10. Shell Programming and Scripting

How to remove leading and trailing spaces for variable in shell script?

Hi I have variable named tablename. The value to tablename variable has leading and trailing white spaces. How to remove the leading and training white spaces and write the value of the tablename without space to a file using shell script. ( for e.g. tablename= yyy ) INPUT ... (10 Replies)
Discussion started by: pottic
10 Replies
SIGSET(3)						     Linux Programmer's Manual							 SIGSET(3)

NAME
sigset, sighold, sigrelse, sigignore - System V signal API SYNOPSIS
#include <signal.h> typedef void (*sighandler_t)(int); sighandler_t sigset(int sig, sighandler_t disp); int sighold(int sig); int sigrelse(int sig); int sigignore(int sig); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): sigset(), sighold(), sigrelse(), sigignore(): _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED DESCRIPTION
These functions are provided in glibc as a compatibility interface for programs that make use of the historical System V signal API. This API is obsolete: new applications should use the POSIX signal API (sigaction(2), sigprocmask(2), etc.) The sigset() function modifies the disposition of the signal sig. The disp argument can be the address of a signal handler function, or one of the following constants: SIG_DFL Reset the disposition of sig to the default. SIG_IGN Ignore sig. SIG_HOLD Add sig to the process's signal mask, but leave the disposition of sig unchanged. If disp specifies the address of a signal handler, then sig is added to the process's signal mask during execution of the handler. If disp was specified as a value other than SIG_HOLD, then sig is removed from the process's signal mask. The dispositions for SIGKILL and SIGSTOP cannot be changed. The sighold() function adds sig to the calling process's signal mask. The sigrelse() function removes sig from the calling process's signal mask. The sigignore() function sets the disposition of sig to SIG_IGN. RETURN VALUE
On success, sigset() returns SIG_HOLD if sig was blocked before the call, or the signal's previous disposition if it was not blocked before the call. On error, sigset() returns -1, with errno set to indicate the error. (But see BUGS below.) The sighold(), sigrelse(), and sigignore() functions return 0 on success; on error, these functions return -1 and set errno to indicate the error. ERRORS
For sigset() see the ERRORS under sigaction(2) and sigprocmask(2). For sighold() and sigrelse() see the ERRORS under sigprocmask(2). For sigignore(), see the errors under sigaction(2). CONFORMING TO
SVr4, POSIX.1-2001. These functions are obsolete: do not use them in new programs. POSIX.1-2008 marks sighold(), sigignore(), sigpause(), sigrelse(), and sigset() as obsolete, recommending the use of sigaction(2), sigprocmask(2), pthread_sigmask(3), and sigsuspend(2) instead. NOTES
These functions appeared in glibc version 2.1. The sighandler_t type is a GNU extension; it is used on this page only to make the sigset() prototype more easily readable. The sigset() function provides reliable signal handling semantics (as when calling sigaction(2) with sa_mask equal to 0). On System V, the signal() function provides unreliable semantics (as when calling sigaction(2) with sa_mask equal to SA_RESETHAND | SA_NODEFER). On BSD, signal() provides reliable semantics. POSIX.1-2001 leaves these aspects of signal() unspecified. See signal(2) for further details. In order to wait for a signal, BSD and System V both provided a function named sigpause(3), but this function has a different argument on the two systems. See sigpause(3) for details. BUGS
In versions of glibc before 2.2, sigset() did not unblock sig if disp was specified as a value other than SIG_HOLD. In versions of glibc before 2.5, sigset() does not correctly return the previous disposition of the signal in two cases. First, if disp is specified as SIG_HOLD, then a successful sigset() always returns SIG_HOLD. Instead, it should return the previous disposition of the sig- nal (unless the signal was blocked, in which case SIG_HOLD should be returned). Second, if the signal is currently blocked, then the return value of a successful sigset() should be SIG_HOLD. Instead, the previous disposition of the signal is returned. These problems have been fixed since glibc 2.5. SEE ALSO
kill(2), pause(2), sigaction(2), signal(2), sigprocmask(2), raise(3), sigpause(3), sigvec(3), signal(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2010-09-20 SIGSET(3)
All times are GMT -4. The time now is 04:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy