Sponsored Content
Top Forums Shell Programming and Scripting Unix remove white spaces/tabs before & after pattern Post 302541661 by gr8_usk on Monday 25th of July 2011 09:32:30 AM
Old 07-25-2011
Unix remove white spaces/tabs before & after pattern

Hi All,

I wanted to know is there any way we can remove white spaces/tabs before & after some pattern { eg. before & after "," }.

Please find below sample data below,

Code:
Sat Jul 23 16:10:03 EDT 2011   ,    12345678 , PROD     , xyz_2345677          , testuuyt                       ,      149693 , abtryu
Jul 22 2011                    ,        NULL , PROD     , yt12345              , testuuytoy                     ,      162469 , abtryu
Jul 22 2011                    ,        NULL , PROD     , yt12345              , testuuytoy                     ,      162469 , abtryu
Jul 22 2011                    ,        NULL , PROD     , yt12345              , testuuytoy                     ,      162469 , abtryu
Jul 22 2011                    ,        NULL , PROD     , yt12345              , testuuytoy                     ,      162469 , abtryu
Jul 22 2011                    ,        NULL , PROD     , yt12345              , testuuytoy                     ,      162469 , abtryu
Jul 22 2011                    ,        NULL , PROD     , yt12345              , testuuytoy                     ,      162469 , abtryu

Please help.
 

9 More Discussions You Might Find Interesting

1. Linux

How do i remove commas(,) & spaces

Hey guys, I am very much new to shell scripts. So you ppl may feel that i am asking stupid question here. :D 1. I am using command line argument as an input variable. The user gets this value in his mail from client which has commas n spaces (Eg. 12,34,56,789) and the scripts... (5 Replies)
Discussion started by: anushree.a
5 Replies

2. Shell Programming and Scripting

spaces or Tabs?

When formatting a script let's say for instance the following: case ${choice} in 1) vi ${tmp1}.tmp # overwrite the tmp1 var with any user changes cp ${tmp1}.tmp ${tmp1} ;; ... (2 Replies)
Discussion started by: llsmr777
2 Replies

3. Shell Programming and Scripting

find & dirname:problems with white spaces in Directories

Hi all, my problem: (little extract from my bash-script) I want to move each file (.mov) from one directory (and many Subdirectories) to another directory (only one); after moving i want to create hardlinks to the old directories. Thatīs no problem, but now: source-directories... (4 Replies)
Discussion started by: tubian
4 Replies

4. UNIX for Dummies Questions & Answers

Problem with White spaces and tabs

Hi All, I am facing issues converting white spaces and tabs together in a file I am reading. Here is the command I am trying: tr -s ' '@ | sort -t@ +1n filename I guess the problem is that it is not converting the tabs to another delimiter. Also, I am supposed to accomplish this only using... (5 Replies)
Discussion started by: sh_kk
5 Replies

5. Shell Programming and Scripting

How to remove white spaces from the beginning an end of a string in unix?

Suppose, I have a variable var=" name is ". I want to remove the blank spaces from the begining and endonly, not from the entire string. So, that the variable/string looks like following var="name is". Please look after the issue. (3 Replies)
Discussion started by: mady135
3 Replies

6. Shell Programming and Scripting

spaces to tabs - group with IP

hi buddies; i have a file.txt: Note: All the seperators are SPACE. 192.168.1.1 ParameterObject=1 Speech 1 ParameterObject=2 Speech 1 192.168.1.1 ParamFunction=1 UserID 1 (DEACTIVATED) Sector=1,Device=2,Unit=3 DeviceId 1 192.168.1.1 FeederCable=2B ... (18 Replies)
Discussion started by: gc_sw
18 Replies

7. Shell Programming and Scripting

Remove spaces / tabs from variable in script

I want to remove extra spaces from variable in aix script. We retrieve the data from oracle database and then print the values. We have a value on 90th position. When we execute the query on sqlplus it shows the length of 90th position as 3, but when we use the same query in aix script it shows... (5 Replies)
Discussion started by: lodhi1978
5 Replies

8. Shell Programming and Scripting

Remove white spaces from flat file generated from Oracle table...

I have to export data from table into flat file with | delimited. In the ksh file, I am adding below to do this activity. $DBSTRING contains the sqlplus command and $SQL_STRING contains the SQL query. File is created properly with the data as per SQL command. I am getting white spaces in the... (1 Reply)
Discussion started by: mgpatil31
1 Replies

9. Shell Programming and Scripting

[Solved] Remove White spaces from teh beginnning from a particular row

Hi All, $sed -n "58p" sample 1222017 --- Its has to display like: 1222017 (5 Replies)
Discussion started by: Anamica
5 Replies
PSMEGAPLOT(1gmt)					       Generic Mapping Tools						  PSMEGAPLOT(1gmt)

NAME
psmegaplot - To create poster-size PostScript plots from page-size plot SYNOPSIS
psmegaplot plotfile -Sscale [ -C ] DESCRIPTION
psmegaplot reads a GMT-produced PostScript file and 'blows it up' by an arbitrary scale. The result is several plots that make up the pieces in a jigsaw puzzle. Cut and paste these pieces to make a 'megaplot'. plotfile PostScript file as created by the GMT programs. -S Multiply the x- and y-dimension by scale. scale must be larger than 1.0. OPTIONS
No space between the option flag and the associated arguments. -C Plot crop marks in each corner of every output page. [Default is no marks] EXAMPLES
To magnify a contour-map PostScript file 3 times, giving a total of 9 output pages to be pasted together, use psmegaplot hawaii_contour.ps -S3 -C > hawaii_contour_megaplot.ps BUGS
This program is unlikely to work on non-GMT-produced PostScript files since it anticipates the structure of the file. It also assumes that the output media is Letter size. SEE ALSO
GMT(1) GMT 4.5.7 15 Jul 2011 PSMEGAPLOT(1gmt)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy