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 > 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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
vi to remove lines in file kjbaumann UNIX for Dummies Questions & Answers 2 03-13-2009 03:40 AM
How to remove a pkg ,urgent!! wrapster SUN Solaris 2 05-11-2008 03:43 AM
remove lines from file bluemoon1 Shell Programming and Scripting 9 11-09-2007 01:40 AM
How to remove all lines with something other than numbers Juha Shell Programming and Scripting 2 09-21-2006 04:48 PM
Remove blank lines osymad UNIX for Dummies Questions & Answers 4 08-27-2005 06:41 AM

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 10-06-2005
kumar1 kumar1 is offline
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
  #2 (permalink)  
Old 10-06-2005
monsanbu monsanbu is offline
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
  #3 (permalink)  
Old 10-06-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

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

vino
  #4 (permalink)  
Old 10-10-2005
sanjustudy sanjustudy is offline
Registered User
  
 

Join Date: Aug 2005
Location: India
Posts: 17
hai ,
use regexp u can remove the unnecessary blank space
  #5 (permalink)  
Old 10-10-2005
kumar1 kumar1 is offline
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
  #6 (permalink)  
Old 10-10-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

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

Dont duplicate your posts. Here is the original post - csplit problem....please help me
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 07:18 PM.


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