Sponsored Content
Top Forums Shell Programming and Scripting Include white spaces while using CUT command Post 302425013 by Sekar1 on Thursday 27th of May 2010 03:24:51 AM
Old 05-27-2010
Include white spaces while using CUT command

Hi
I tried to extract 19 characters (default) enclosed with in tag from a file using cut command. If the characters comprises of double space, the cut command gives the output with a single spacing.

file 1
<name>Kumar Rajasekaran</name>

Code:
cut -c7-26 "file1"

the out put i received is
Code:
Kumar Rajasekaran

Expected output
Code:
Kumar   Rajasekaran

Please guide me.
Thanks

Last edited by Franklin52; 05-27-2010 at 05:24 AM.. Reason: Placing correct code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting white spaces

How would I delete white spaces in a specified file? Also, I'd like to know what command I would use to take something off a regular expression, and put it onto another. ie. . . . expression1 <take_off> . . . expression2 (put here) . . . Any help would be great, thanks! (10 Replies)
Discussion started by: cary530
10 Replies

2. Shell Programming and Scripting

delete white spaces

hi all... i have the next question: i have a flat file with a lot of records (lines). Each record has 10 fields, which are separated by pipe (|). My problem is what sometimes, in the first record, there are white spaces (no values, nothing) in the beginning of the record, like this: ws ws... (2 Replies)
Discussion started by: DebianJ
2 Replies

3. Shell Programming and Scripting

trimming white spaces

I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies

4. Shell Programming and Scripting

Two or more white spaces in string

Hi, Can anybody suggest me how to combine two strings with two or more white spaces and assign it to a variable? E.g. first=HAI second=HELLO third="$first $second" # appending strings with more than one white spaces echo $third this would print HAI HELLO Output appears... (2 Replies)
Discussion started by: harish_oty
2 Replies

5. UNIX for Dummies Questions & Answers

Removing Double Spaces for cut command

Hi I have a shell script that looks for running processes in order to kill them. The script (ksh) gets the PID of these processes using the following: PROCS=`ps -fu ${USERID} | egrep "MONITOR" | grep -v grep | cut -d" " -f4` However, I spotted an issue where PID's of different lengths... (3 Replies)
Discussion started by: mikem22
3 Replies

6. Shell Programming and Scripting

How to Use Sed Command to replace white spaces with comma from between two fields - Mayank

SHELL SCRIPT Hi I have a file in the following format Mayank Sushant Dheeraj Kunal ARUN Samir How can i replace the white space in between and replace them with a comma?? The resultant output should be Mayank,Sushant Dheeraj,Kunal ARUN,Samir i tried using sed -e... (8 Replies)
Discussion started by: mayanksargoch
8 Replies

7. Shell Programming and Scripting

Cut command skips spaces

Hi everyone I have a file looks like this X01 1 JOE 20100312 X02 TOD 20100312 X03 3 SAM 20100312 I wrote a script to assign the values in 5 columns to 5 variables. When I use cut command to assign column 2 or 3, it skips it if it is a space (see below) ... (3 Replies)
Discussion started by: nimo
3 Replies

8. Shell Programming and Scripting

Leading white spaces

Hi, I am having problem in deleting the leading spaces:- cat x.csv baseball,NULL,8798765,Most played baseball,NULL,8928192,Most played baseball,NULL,5678945,Most played cricket,NOTNULL,125782,Usually played cricket,NOTNULL,678921,Usually played $ nawk 'BEGIN{FS=","}!a... (2 Replies)
Discussion started by: scripter12
2 Replies

9. Shell Programming and Scripting

Shell command to Strip white spaces at specific location

Hello, I have a Comma separated input file with one of the sample records as below: -9223372036854477528,"834","834003325515BXNI00101012013C","5","PLAN_VALUE","PPO, General Cable","C",20130101,99991231,"A","2012-12-25-13.58.14.434000","ZPL2 ","2012-12-25-13.58.14.434000","ZPL2 ... (4 Replies)
Discussion started by: Praveenkulkarni
4 Replies

10. Shell Programming and Scripting

Include information and change column order while maintaing white spaces

I need to change the order of the columns of data that looks like this: The original data is in 6 tab-separated columns. FACTSHEET factsheet NN 1 5 DEP WHAT what WP 2 3 SBJ IS be VBZ 3 1 NMOD AIDS AIDS NP ... (1 Reply)
Discussion started by: owwow14
1 Replies
POSTLOG(1)						      General Commands Manual							POSTLOG(1)

NAME
postlog - Postfix-compatible logging utility SYNOPSIS
postlog [-iv] [-c config_dir] [-p priority] [-t tag] [text...] DESCRIPTION
The postlog(1) command implements a Postfix-compatible logging interface for use in, for example, shell scripts. By default, postlog(1) logs the text given on the command line as one record. If no text is specified on the command line, postlog(1) reads from standard input and logs each input line as one record. Logging is sent to syslogd(8); when the standard error stream is connected to a terminal, logging is sent there as well. The following options are implemented: -c config_dir Read the main.cf configuration file in the named directory instead of the default configuration directory. -i Include the process ID in the logging tag. -p priority (default: info) Specifies the logging severity: info, warn, error, fatal, or panic. With Postfix 3.1 and later, the program will pause for 1 second after reporting a fatal or panic condition, just like other Postfix programs. -t tag Specifies the logging tag, that is, the identifying name that appears at the beginning of each logging record. A default tag is used when none is specified. -v Enable verbose logging for debugging purposes. Multiple -v options make the software increasingly verbose. ENVIRONMENT
MAIL_CONFIG Directory with the main.cf file. CONFIGURATION PARAMETERS
The following main.cf parameters are especially relevant to this program. The text below provides only a parameter summary. See postconf(5) for more details including examples. config_directory (see 'postconf -d' output) The default location of the Postfix main.cf and master.cf configuration files. import_environment (see 'postconf -d' output) The list of environment parameters that a privileged Postfix process will import from a non-Postfix parent process, or name=value environment overrides. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd". SEE ALSO
postconf(5), configuration parameters syslogd(8), syslog daemon LICENSE
The Secure Mailer license must be distributed with this software. AUTHOR(S) Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA POSTLOG(1)
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy