Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Removing double spaces in code Post 302652773 by figaro on Thursday 7th of June 2012 05:05:04 PM
Old 06-07-2012
Thank you for your prompt answer. First of all, I think it should be this:
Code:
sed '/  \/\/\|^  /!{s/  / /g;!p}' infile

ie replacement of a double space with a single space instead of removal of the double space ("s/ / /g").
Secondly, the following test case has issues:
Code:
   this is a line with double  space

is unaffected: lines with a double space and indented with spaces is unaffected.
How would I correct it?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing spaces between records

Hi I have an XML file. Which has spaces between different records.... current file( Has many lines, like this... I want to delete all the spaces between > and <, if there are only spaces between them) input file <xyzr> <abc>1234</xyzr> <aaa> <bbb> ayz mnz</bbb> <sen>KEA... (6 Replies)
Discussion started by: thanuman
6 Replies

2. Shell Programming and Scripting

removing spaces

hey.. i had a problem with the unix command when i want to remove the white spaces in a string..i guess i cud do it with a sed command but i get an error when i give space in the square brackets.. string="nh hjh llk" p=`echo $string | sed 's/ //g'` i donno how to give space charater and... (2 Replies)
Discussion started by: sahithi_khushi
2 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Removing spaces...

Hey, I'm using the command from this thread https://www.unix.com/unix-dummies-questions-answers/590-converting-list-into-line.html to convert vertical lines to horzontal lines. But I need to remove the spaces that is created. Unfortunately I can't figure out where the space is in the code.. I... (2 Replies)
Discussion started by: lost
2 Replies

5. Shell Programming and Scripting

Removing spaces from string

I want a user to be able to paste in a string like "01 3F 20 1F" and have the script reformat it to "013F201F" to pass it on to the next step. I was trying to figure it out with awk but wasnt working well. Never mind, found answer. did not know about tr :) (7 Replies)
Discussion started by: ippy98
7 Replies

6. Shell Programming and Scripting

Removing blank spaces, tab spaces from file

Hello All, I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out. My file is like this (<b> means one blank space, <t> means one tab space)- $ cat file NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies

7. Shell Programming and Scripting

removing spaces in filenames

I have a problem mounting images because of the spaces in the filenames. Does anyone know how to rename files by removing the spaces with the find command? find Desktop/$dir -name "*.dmg" -print -exec ??? (4 Replies)
Discussion started by: ianebaj
4 Replies

8. UNIX for Dummies Questions & Answers

Removing spaces in the second field alone

Consider my input string as "abc|b f g|bj gy" I am expecting the output as "abc|bfg|bj gy". Please let me know how to achieve this in unix? Thanks (8 Replies)
Discussion started by: pandeesh
8 Replies

9. Solaris

Removing blank spaces

Hi , I want to go out of vi editor temporarily and execute a command in command prompt and again going back to the editor . Is it possible . Any help on this is really helpful. 1. Need to open vi 2. Temporarily come out and execute a command and go back to vi editor (6 Replies)
Discussion started by: rogerben
6 Replies

10. Shell Programming and Scripting

Removing blanks, spaces

I have pipe separated file with lots of blank spaces. After using sed -e 's/ *| */|/g' this command ,its giving me output as TT0000013101640| HCAMBLAMCNB010|Jul 3 2012 11:14AM| HARYANA| Bangali Mohalla | TCL-UBR|9368040005|9355264655|9218509220|NULL ... (5 Replies)
Discussion started by: sususa
5 Replies
LEGENDRE(3)						User Contributed Perl Documentation					       LEGENDRE(3)

NAME
PDL::GSLSF::LEGENDRE - PDL interface to GSL Special Functions DESCRIPTION
This is an interface to the Special Function package present in the GNU Scientific Library. SYNOPSIS
Functions FUNCTIONS
gsl_sf_legendre_Pl Signature: (double x(); double [o]y(); double [o]e(); int l) P_l(x) gsl_sf_legendre_Pl_array Signature: (double x(); double [o]y(num); int l=>num) P_l(x) from 0 to n-1. gsl_sf_legendre_Ql Signature: (double x(); double [o]y(); double [o]e(); int l) Q_l(x) gsl_sf_legendre_Plm Signature: (double x(); double [o]y(); double [o]e(); int l; int m) P_lm(x) gsl_sf_legendre_Plm_array Signature: (double x(); double [o]y(num); int l=>num; int m) P_lm(x) for l from 0 to n-2+m. gsl_sf_legendre_sphPlm Signature: (double x(); double [o]y(); double [o]e(); int l; int m) P_lm(x), normalized properly for use in spherical harmonics gsl_sf_legendre_sphPlm_array Signature: (double x(); double [o]y(num); int n=>num; int m) P_lm(x), normalized properly for use in spherical harmonics for l from 0 to n-2+m. gsl_sf_conicalP_half Signature: (double x(); double [o]y(); double [o]e(); double lambda) Irregular Spherical Conical Function P^{1/2}_{-1/2 + I lambda}(x) gsl_sf_conicalP_mhalf Signature: (double x(); double [o]y(); double [o]e(); double lambda) Regular Spherical Conical Function P^{-1/2}_{-1/2 + I lambda}(x) gsl_sf_conicalP_0 Signature: (double x(); double [o]y(); double [o]e(); double lambda) Conical Function P^{0}_{-1/2 + I lambda}(x) gsl_sf_conicalP_1 Signature: (double x(); double [o]y(); double [o]e(); double lambda) Conical Function P^{1}_{-1/2 + I lambda}(x) gsl_sf_conicalP_sph_reg Signature: (double x(); double [o]y(); double [o]e(); int l; double lambda) Regular Spherical Conical Function P^{-1/2-l}_{-1/2 + I lambda}(x) gsl_sf_conicalP_cyl_reg_e Signature: (double x(); double [o]y(); double [o]e(); int m; double lambda) Regular Cylindrical Conical Function P^{-m}_{-1/2 + I lambda}(x) gsl_sf_legendre_H3d Signature: (double [o]y(); double [o]e(); int l; double lambda; double eta) lth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space. gsl_sf_legendre_H3d_array Signature: (double [o]y(num); int l=>num; double lambda; double eta) Array of H3d(ell), for l from 0 to n-1. AUTHOR
This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it> All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL SF modules were written by G. Jungman. perl v5.8.0 2003-01-29 LEGENDRE(3)
All times are GMT -4. The time now is 04:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy