The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
VIM tabs... xyzt UNIX and Linux Applications 2 06-10-2008 10:27 AM
Color those tabs! iBot UNIX and Linux RSS News 0 12-10-2007 02:40 AM
removing tabs nbvcxzdz Shell Programming and Scripting 7 03-29-2005 07:49 AM
Cron Tabs rocker40 UNIX for Dummies Questions & Answers 1 12-23-2003 09:10 AM
Converting tabs in to spaces. indo1144 Shell Programming and Scripting 3 06-28-2002 02:56 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-17-2006
Registered User
 

Join Date: Feb 2006
Posts: 27
removing certain tabs

I have a tab delimited file with many lines, one for each record.

each line is tab delimited with a tab before the first data field, a tab between each data field, and a tab after the last data field before it moves onto the next line.

I need to remove only the preceeding tab before the first data field and the tab after the last data field.

I'm sure this can be done with sed, but I don't really know the command that well.

Can anyone help?
Reply With Quote
Forum Sponsor
  #2  
Old 08-17-2006
tayyabq8's Avatar
Moderator
 

Join Date: Nov 2004
Location: Bahrain
Posts: 555
Can you put some sample input data here and sample of the output you want?
Reply With Quote
  #3  
Old 08-17-2006
Registered User
 

Join Date: Aug 2006
Posts: 69
Hi you can try something like this........

cat test | sed -e 's/^ //g' -e 's/ $//g' > 1


regards
Apoorva Kumar
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0