Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Combine fields and eliminate white space Post 302218523 by ski on Friday 25th of July 2008 10:41:56 AM
Old 07-25-2008
Bug Combine fields and eliminate white space

Good Morning,
Newbie here. Could someone help with shell scripting that will enable me to combine 2 fields into one eliminating the white space. The fields are fixed but the data of course varies.
For example:
First Name: "George " 20 positions"
Last Name: "Washington " 30 positions"

I need to create one field with First and Last Name eliminating the space after George into a fixed field length of 50.

Result:
Name: "George Washington "

Appreciate any help.
Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to keep white space is being deleted using read

I am using Posix shell to write a script. The problem I am having is that when I use the read command to go through a file I lose the tabs. How can I keep this from happening? (1 Reply)
Discussion started by: keelba
1 Replies

2. Shell Programming and Scripting

stripping white space...

Hi All; Having a problem with a file.. the file contains the following data... (a snapshot) 1331F9E9DB7C2BB80EAEDE3A8F043B94,AL7 1DZ,M,50 186FDF93E1303DBA217279EC3671EA91,NG5 1JU,M,24 3783FFAF602015056A8CD21104B1AAAF,CH42 4NQ,M,17 It has 3 columns sepreated by a , the second column... (7 Replies)
Discussion started by: Zak
7 Replies

3. UNIX for Dummies Questions & Answers

SED with White Space

Dear Members, Suppose i have a variable test which stores a string as below: test='John drives+++++++++a+++++car' now i want to use sed on the above variable and replace + with a white space, so that i get echo $test should give me 'john drives a car' Between... (1 Reply)
Discussion started by: sandeep_1105
1 Replies

4. Shell Programming and Scripting

Delete trailing white space

I have a string "disk0 with a trailing white space after it" but I want to get rid of this white space from right to left so that I am left with "disk0" only. Using sed 's/ $//g' doesn't seem to work Any ideas ? Thanks (5 Replies)
Discussion started by: cillmor
5 Replies

5. Shell Programming and Scripting

script to eliminate left and right fields and to get the ouput.

Hi Experts, I have a file as given below and want to filter out the filenames in it , by deleting left and right filds and to have the fllenames (There are spaces in the filename), Sun Jan 11 11:20:10 2009 1 0 /home/output/file2311_recent.list user1 user2 0 done Sun Jan 11 11:20:10 2009 1 0... (10 Replies)
Discussion started by: rveri
10 Replies

6. Shell Programming and Scripting

sed + white space

Hi, What sed command (if sed is the right command) can remove ALL white space from my file. I have a csv, except I want to remove all white space between commas and characters. My idea (without testing) sed 's/ //g' Is there a better way? (18 Replies)
Discussion started by: mcclunyboy
18 Replies

7. UNIX for Dummies Questions & Answers

filename with white space

our user creates a text file with a white space on the filename. this same file is transfered to unix via automation tool. i have a korn shell script that reads these files on a input directory and connects to oracle database to run the oracle procedures which will load the data from each of the... (2 Replies)
Discussion started by: wtolentino
2 Replies

8. Shell Programming and Scripting

Remove unwanted white space

Hi, I have a very big file 25GB with information present in it like $ head ind_stats update index statistics pfirm001.dbo.Office using 200 values go ... (11 Replies)
Discussion started by: sam05121988
11 Replies

9. Shell Programming and Scripting

Add white space

hi guys how can i add spacein file name with sed if strings have no space around dash input 19-20 ( 18-19 ) ABC-EFG output after add white space 19 - 20 (18 - 19 ) ABC - EFG thx in advance (2 Replies)
Discussion started by: mhs
2 Replies

10. Shell Programming and Scripting

Preserve leading white space

I have about 350 programs in which I have to add 2 lines; one before and one after a specfic line. The following script does the job except that I lose the indentation. #!/usr/bin/bash while read line ... (8 Replies)
Discussion started by: jgt
8 Replies
NAD2NAD(1)						      General Commands Manual							NAD2NAD(1)

NAME
nad2nad - North American Datum conversion filter SYNOPSIS
nad2nad [ -eEfihortwW [ args ] ] [ +args ] file[s] DESCRIPTION
Program nad2nad is a filter to convert data between North America Datum 1927 (NAD27) and North American Datum 1983. nad2nad can optionally process both State Plane Coordinate System (SPCS) and Universal Transverse Mercator (UTM) grid data as well as geographic data for both input and output. This can also be accomplished with the cs2cs program. The following control parameters can appear in any order: -[i|o] keyword[,keyword] The -i and -o option expect keyword arguments which define various characteristics and processing modes of the respective input data. Usage allows multiple arguments to be included with a - operator when separated by commas. Datum conversion requires the data to be in geographic coordinates, but nad2nad will allow conversion of data to and from SPCS or UTM grid systems. The following are keywords and arguments recognized by both the -i and -o that will apply to respective input and output conversion of user data to internal geographic coordinates: 27|83 datum of data utm=n UTM coordinates in meters for zone n spcs=n for data in SPCS coordinates, where n is state zone number. feet data units are in U.S. Surveyor's feet. This is allowed only when the spcs option been previously used. Default coordi- nates are in meters. bin for data in binary form. rev data in lat-lon order rather than default lon-lat order. hp=ss use high precision conversion zone ss. Certain States have ancillary correction tables to further refine the basic conus table. Ss key and States are: FL Florida MD Maryland TN Tennessee WI Wisconsin WO Washington, Oregon and northern part of California. -ta A specifies a character employed as the first character to denote a control line to be passed through without processing. This option applicable to ascii input only. (# is the default value). -e string String is an arbitrary string to be output if an error is detected during data transformations. The default value is: * *. Note that if the -o bin option is employed, an error is output as HUGE_VAL for both values. -r region specifies which regional conversion table to employ which are identified by the following: conus - conterminous 48 States alaska - State of Alaska hawaii - State of Hawaii prvi - Puerto Rico and Virgin Islands stgeorge - St. George Is, Alaska stpaul - St. Paul Is, Alaska stlrnc - St. Lawrence Is, Alaska -E Input coordinates are echoed to output before ouput values. -f format Format is a printf format string to control the form of the output values. For inverse projections, the output will be in degrees when this option is employed. If a format is specified for inverse projection the output data will be in decimal degrees. The default format is %.2f for forward projection and DMS for inverse. -[w|W]n N is the number of significant fractional digits to employ for seconds output (when the option is not specified, -w3 is assumed). When -W is employed the fields will be constant width and with leading zeroes. One or more files (processed in left to right order) specify the source of data to be transformed. A - will specify the location of pro- cessing standard input. If no files are specified, the input is assumed to be from stdin. For ASCII input data the two data values must be in the first two white space separated fields and when both input and output are ASCII all trailing portions of the input line are appended to the output line. Input geographic data (longitude and latitude) must be in DMS format when neither utm nor spcs is specified, otherwise in meters or feet (feet option used). Input data fields must be separated by white space and not have imbedded white space. Output data will be in tab separated fields of DMS or grid coordinates in meters or feet. Any data after the two input values are echoed after the two output data values. SEE ALSO
cs2cs(1U), proj(1U), Cartographic Projection Procedures for the UNIX Environment--A User's Manual, (Evenden, 1990, Open-file report 90-284). HOME PAGE
http://www.remotesensing.org/proj 2000/03/21 Rel. 4.4 NAD2NAD(1)
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy