LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with script removing white space from a file (http://www.linuxquestions.org/questions/linux-newbie-8/help-with-script-removing-white-space-from-a-file-742250/)

tebucky 07-23-2009 10:29 AM

Help with script removing white space from a file
 
All,

I have a fairly large file where each line looks like this:

/^.*@(.+\.)* test.us $/ test.com

What I want to do is remove all the white space from this portion:

/^.*@(.+\.)* test.us $/

and leave space between the / and test.com

Can anyone help? My shell scripting/sed skills are pretty weak.

Thanks!

konsolebox 07-23-2009 10:38 AM

can you give us sample texts instead please

catkin 07-23-2009 11:04 AM

Hello tebucky :)
Quote:

Originally Posted by tebucky (Post 3617815)
All,

I have a fairly large file where each line looks like this:

/^.*@(.+\.)* test.us $/ test.com

What I want to do is remove all the white space from this portion:

/^.*@(.+\.)* test.us $/

and leave space between the / and test.com

Can anyone help? My shell scripting/sed skills are pretty weak.

Thanks!

If it's a large file then sed or awk would be better choices than shell script; shell script would be relatively slow.

As konsolebox asked, can we have some actual texts? "/^.*@(.+\.)* test.us $/" looks as if you are defining the lines using a regular expression which, all due respect, may not be right if your sed skills are weak like you say -- plus it's better for us to test solutions on data than on meta data.

Best

Charles


All times are GMT -5. The time now is 11:14 AM.