The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Trim trailing spaces from each line in a file tipsy Shell Programming and Scripting 5 09-13-2006 05:48 AM
Removing trailing spaces from delimited files djkane Shell Programming and Scripting 6 03-29-2006 06:11 AM
Removing leading and trailing spaces of data between the tags in xml. jhmr7 UNIX for Dummies Questions & Answers 2 05-18-2005 10:27 AM
Strip leading and trailing spaces only in a shell variable with embedded spaces jerardfjay Shell Programming and Scripting 6 03-07-2005 02:24 PM
Adding Trailing Spaces to a file 222001459 UNIX for Dummies Questions & Answers 1 11-04-2004 03:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-10-2002
rooh rooh is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 62
removing trailing spaces of a particular column in a file

Hi,

I am currently confused.

Suppose I have a file something like the one below.
4299|raj Telecommunications|12|||||
4302|anjali International Ltd.|86|ritchie||dong|(000)2890 9993 |(222)4881 3689
4305|フィデ*シアリ・トラスト・インターナショナル投資顧問*式会社 |112||||01-9211-1931 |08-3677-1985

Now what I have found is that if it finds the second field empty it puts these strange characters.

What I think is that it is because of the blank spaces.
Is there a way that I can avoid it.


Thanks.
Rooh
  #2 (permalink)  
Old 01-10-2002
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
You may want to post your script regarding this.
What is perusing the input file?
  #3 (permalink)  
Old 01-12-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
You may want to make a new data file.

Use awk

cat file1 | awk -F| '{ print $0 }' > newfile

The character after the -F is a Pipe to designate your delimiter in the file.

Then try your script again. This should get rid of Unprintable chars in your file.


Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0