help me to remove the whitespaces between the lines ...urgent


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help me to remove the whitespaces between the lines ...urgent
# 1  
Old 10-06-2005
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  
Old 10-06-2005
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  
Old 10-06-2005
Code:
tr -d '\n\t ' < kumar.txt

kumar.txt contains the tab, white spaces and new line delimited lines.

vino
# 4  
Old 10-10-2005
hai ,
use regexp u can remove the unnecessary blank space
# 5  
Old 10-10-2005
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  
Old 10-10-2005
Kumar,

Dont duplicate your posts. Here is the original post - csplit problem....please help me
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Remove whitespaces between delimiter and characters

Hello All, I have a pipe delimited file and below is a sample data how it looks: CS123 | | || 5897 | QXCYN87876 As stated above, the delimited files contains sometimes only spaces as data fields and sometimes there are extra spaces before/after numeric/character data fields. My requirement... (4 Replies)
Discussion started by: amvip
4 Replies

2. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Post Here to Contact Site Administrators and Moderators

Urgent : please remove the names from the post

Hi Sir, There is an escalation going on this and could you please remove the words from the following link . this is really critical. https://www.unix.com/shell-programming-and-scripting/196647-remove-headings.html please remove following terms fiappl17dev fiappl18dev ... (1 Reply)
Discussion started by: ptappeta
1 Replies

4. UNIX for Dummies Questions & Answers

awk - (URGENT!) Print lines sort and move lines if match found

URGENT HELP IS NEEDED!! I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but - Currently, script is not printing lines to File3.txt in order. - Also the matching lines are not moving out of File1.txt ... (1 Reply)
Discussion started by: High-T
1 Replies

5. UNIX for Dummies Questions & Answers

Urgent - XML Attribute Remove

Hi I have got a XML file which has got content as follows: <FUNCall81110000 Tag="81110000" CallDate="25/08/11" CallTime="00:03:22" TotalUsageValue="30" MeasurementUnit="1"/> I want to remove TotalUsageValue="30" only and TotalUsageValue="XXXXX" here XXX can be any value. (1 Reply)
Discussion started by: muchyog
1 Replies

6. Shell Programming and Scripting

remove blank lines and merge lines in shell

Hi, I'm not a expert in shell programming, so i've come here to take help from u gurus. I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command. I've a datatable csv of the below format - --in file format xx,xx,xx ,xx , , , , ,,xx, xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies

7. Shell Programming and Scripting

Remove whitespaces in the n first characters?

I assume removing whitespaces in the n first characters of a string would be an easy task for sed? If so, how? (7 Replies)
Discussion started by: KidCactus
7 Replies

8. UNIX for Dummies Questions & Answers

Remove whitespaces between comma separated fields from file

Hello all, I am a unix dummy. I am trying to remove spaces between fields. I have the file in the following format 12332432, 2345 , asdfsdf ,100216 , 9999999 12332431, 2341 , asdfsd2 ,100213 , 9999999 &... (2 Replies)
Discussion started by: nitinbjoshi
2 Replies

9. Solaris

How to remove a pkg ,urgent!!

HI all, I would like to know, how we can remove a package? I know that pkgrm will do the job ,but specifying the right kinda package is important.. And i dont know how to figure that one out? Eg:if i have installed a pkg called virtualbox, If i do, pkgrm SUNWvirtualbox ,it says "no such file... (2 Replies)
Discussion started by: wrapster
2 Replies
Login or Register to Ask a Question