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
How to remove a pkg ,urgent!! wrapster SUN Solaris 2 05-11-2008 12:43 AM
remove lines from file bluemoon1 Shell Programming and Scripting 9 11-08-2007 10:40 PM
vi to remove lines in file kjbaumann UNIX for Dummies Questions & Answers 1 10-03-2007 12:25 PM
How to remove all lines with something other than numbers Juha Shell Programming and Scripting 2 09-21-2006 01:48 PM
Remove blank lines osymad UNIX for Dummies Questions & Answers 4 08-27-2005 03:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-06-2005
Registered User
 

Join Date: Oct 2005
Posts: 4
help me to remove the whitespaces between the lines ...urgent

Hello all,
i have a problem.
please help me to remove the white spaces and tabs betweeen line.
i.e.,
file1 contains some text..
text starts_hdsffdsd
sdfsddssdds********
sdfsdsd***********
sdfsdsdfsdsdfsdsds***
****fsd_test_ends

one or 2 blank lines

(* indicates white spaces or tabs)

please help me to remove all blank line and white spaces.
my final file should contain entire text in a single line. like as follows.

text starts_hdsffdsdsdfsddssddssdfsdsdsdfsdsdfsdsdfsdsdssdfsd_test_ends

waitng for ur reply.

Kumar
Reply With Quote
Forum Sponsor
  #2  
Old 10-06-2005
Registered User
 

Join Date: Sep 2005
Location: Chennai,India
Posts: 12
Hi,

Try this command

Code:
  

grep -v '^$' remove_wp.txt | sed -e 's/ //g' -e 's/    //g' | sed 'N;N;s/\n//g'

-Mons
Reply With Quote
  #3  
Old 10-06-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,681
Code:
tr -d '\n\t ' < kumar.txt
kumar.txt contains the tab, white spaces and new line delimited lines.

vino
Reply With Quote
  #4  
Old 10-10-2005
Registered User
 

Join Date: Aug 2005
Location: India
Posts: 17
hai ,
use regexp u can remove the unnecessary blank space
Reply With Quote
  #5  
Old 10-10-2005
Registered User
 

Join Date: Oct 2005
Posts: 4
Dear Friends,
thanks for ur replis,

it will be a great help if u solve the following problem

I am using csplit to split the files,
i.e.,
csplit -f filetype_ -n 3 filename '/regexpn/' {5}
which will split file "filename" into 5 subfiles
filetype_000
filetype_001
filetype_002
filetype_003
filetype_004

but if I run the csplit commad again it will rewrite the previous subfiles.
What I need is to continue with existing files
i.e., if I run the csplit command,
it should continue to split files and produce follwoing subfiles
filetype_005
filetype_006
filetype_007
filetype_008
filetype_009

do not affecting
filetype_000
filetype_001
filetype_002
filetype_003
filetype_004

and finally I should have
filetype_000
filetype_001
filetype_002
filetype_003
filetype_004
filetype_005
filetype_006
filetype_007
filetype_008
filetype_009


please tell me how do I proceed.


Thanks in advance,
Kumar
Reply With Quote
  #6  
Old 10-10-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,681
Kumar,

Dont duplicate your posts. Here is the original post - csplit problem....please help me
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:34 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