Sponsored Content
Top Forums Shell Programming and Scripting Removing blank spaces, tab spaces from file Post 302342008 by NARESH1302 on Friday 7th of August 2009 07:15:47 AM
Old 08-07-2009
Removing blank spaces, tab spaces from file

Hello All,

I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.

My file is like this (<b> means one blank space, <t> means one tab space)-

$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN
<t><t>RAJESH<b><b><b><b><t><t>MITRA

The code should give the following output-

NARESH KUMAR PRADHAN
RAJESH MITRA


Note-
  1. All the tab spaces got removed and treated as single blankspace.
  2. All the blank spaces were removed and treated as single blank space.
Thanks,
Naresh
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing blank spaces from a file?

Guys, I need some help... how can I remove the blank spaces between the lines below? (between the date and the hour fields) 21/05/07 00:05:00 99 21/05/07 00:10:01 99 21/05/07 00:15:00 99 21/05/07 00:20:00 99 21/05/07 00:25:00 99 I want to make the file... (4 Replies)
Discussion started by: dfs
4 Replies

2. Shell Programming and Scripting

Replace blank spaces by single tab, and right alignment

Folks, I am wondering if anyone solve this problem. What I want to know is, 1. Delete all white spaces including leading blank space in each line (e.g. line 2), and replace such spaces by single tab except leading blank space 2. Then, align all columns to the right. But, output white space... (1 Reply)
Discussion started by: Jae
1 Replies

3. UNIX for Dummies Questions & Answers

Removing blank spaces from text files in UNIX

Hello, I am an super newbie, so forgive my sheer ignorance. I have a series of text files formatted as follows (just showing the header and first few lines): mean_geo mean_raw lat lon 0.000 0 -70.616 163.021 0.000 0 -70.620 163.073 0.000 ... (8 Replies)
Discussion started by: vtoniolo
8 Replies

4. Shell Programming and Scripting

removing blank spaces in a script

Hi I am writing a shell to run sqlplus scripts. i found a issue in my scripts that oracle will not spool a file if there is blank spaces in the word like /backup dir/scriptrelease/1_DDL or /backupdir/script release/2_DDL can we write some thing in the shell to make "/backup dir" to... (1 Reply)
Discussion started by: srichunduru
1 Replies

5. Shell Programming and Scripting

Help with removal of blank spaces in a file

Hello.. I have a text file. I want to remove all the blank spaces(except tab) from the file.. I tried using sed command as shown below sed 's/ //g' file1 But the problem with the above command is that it also eliminates 'tab' which is between the columns.. For example if the contents... (7 Replies)
Discussion started by: abk07
7 Replies

6. Solaris

Removing blank spaces

Hi , I want to go out of vi editor temporarily and execute a command in command prompt and again going back to the editor . Is it possible . Any help on this is really helpful. 1. Need to open vi 2. Temporarily come out and execute a command and go back to vi editor (6 Replies)
Discussion started by: rogerben
6 Replies

7. Emergency UNIX and Linux Support

Removing ONLY UNIQUE blank spaces with sed?

Hi, I have data that looks similar to this: In which the sentences are written horizontally and the beginning of a sentence is indicated by a 1 in the first column and the number increments until the last item of the sentence. The end of the sentence and the beginning of the next is then indicate... (1 Reply)
Discussion started by: owwow14
1 Replies

8. Shell Programming and Scripting

Removing blank/white spaces and special characters

Hello All , 1. I am trying to do a task where I need to remove Blank spaces from my file , I am usingawk '{$1=$1}{print}' file>file1Input :- ;05/12/1990 ;31/03/2014 ; Output:- ;05/12/1990 ;31/03/2014 ;This command is not removing all spaces from... (6 Replies)
Discussion started by: himanshu sood
6 Replies

9. UNIX for Advanced & Expert Users

Delete blank spaces and blank lines in a file

Hi Gurus, Somebody can say me how to delete blank spaces and blank lines in a file unix, please. Thank you for advanced. (10 Replies)
Discussion started by: systemoper
10 Replies

10. Shell Programming and Scripting

Removing tab spaces at the end of each line

I have a file which contains the data lines like below.I want to remove the tab spaces at the end of each line.I have tried with the command sed 's/\+$//' file.but it does not work.Can anyone help me on this? 15022 15022 15022 15022 15022 15022 15023 15023 15023 15023 15023 ... (16 Replies)
Discussion started by: am24
16 Replies
genpng(1)							   User Manuals 							 genpng(1)

NAME
genpng - Generate an overview image from a source file SYNOPSIS
genpng [-h|--help] [-v|--version] [-t|--tab-size tabsize] [-w|--width width] [-o|--output-filename output-filename] source-file DESCRIPTION
genpng creates an overview image for a given source code file of either plain text or .gcov file format. Note that the GD.pm Perl module has to be installed for this script to work (it may be obtained from http://www.cpan.org). Note also that genpng is called from within genhtml so that there is usually no need to call it directly. OPTIONS
-h --help Print a short help text, then exit. -v --version Print version number, then exit. -t tab-size --tab-size tab-size Use tab-size spaces in place of tab. All occurrences of tabulator signs in the source code file will be replaced by the number of spaces defined by tab-size (default is 4). -w width --width width Set width of output image to width pixel. The resulting image will be exactly width pixel wide (default is 80). Note that source code lines which are longer than width will be truncated. -o filename --output-filename filename Write image to filename. Specify a name for the resulting image file (default is source-file.png). AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com> SEE ALSO
lcov(1), genhtml(1), geninfo(1), gendesc(1), gcov(1) 2010-08-06 LCOV 1.9 genpng(1)
All times are GMT -4. The time now is 07:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy