Sponsored Content
Top Forums Shell Programming and Scripting How to delete ending/trailing spaces using awk,sed,perl? Post 302447099 by cola on Saturday 21st of August 2010 01:17:19 AM
Old 08-21-2010
How to delete ending/trailing spaces using awk,sed,perl?

How to delete ending/trailing spaces using awk,sed,perl?
InputSmilieeach line has extra spaces at the end)
Code:
3456 565     
3 7       
35 878

Expected output:
Code:
3456 565
3 7 
35 878

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strip leading and trailing spaces only in a shell variable with embedded spaces

I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help. echo $SH_VAR | command_line Syntax. The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies

2. UNIX for Dummies Questions & Answers

How to remove trailing spaces

Hi, I have a file like this (ADD_MONTHS((Substr(Trim(BOTH FROM Translate(Maximum(closeDa ------------------------------------------------------------ 2007-06-30 00:00:00 I have a requirement where i need just the date. When i do: tail -1... (2 Replies)
Discussion started by: mahek_bedi
2 Replies

3. Shell Programming and Scripting

Delete lines ending in "_;" using sed

I could really use some help with this issue. I'm having a lot of trouble getting my sed command to delete only the lines from my file that end with _; I'm also supposed to carry the leading 'c' down to the next line. The commands I've tried either delete everything or nothing at all. Any help... (12 Replies)
Discussion started by: turbulence
12 Replies

4. Shell Programming and Scripting

Removing leading and trailing spaces only in PERL

Hi All, I have a file with the following contents with multiple lines 172445957| 000005911|8| 400 Peninsula Ave.#1551 | And,K |935172445957|000005911 607573888 |000098536 | 2|Ane, B |J |Ane |1868 |19861206|20090106|20071001 I want to trim the "leading and trailing spaces only" from... (2 Replies)
Discussion started by: kumar04
2 Replies

5. Shell Programming and Scripting

awk/sed/perl command to delete specific pattern and content above it...

Hi, Below is my input file: Data: 1 Length: 20 Got result. Data: 2 Length: 30 No result. Data: 3 Length: 20 (7 Replies)
Discussion started by: edge_diners
7 Replies

6. Shell Programming and Scripting

[solved] Trailing spaces

Hello People How to check whether lines in a text file have trailing spaces or not and if a line have trailing spaces then how many trailing spaces line have? Regards ARvind kumar (5 Replies)
Discussion started by: arvindk.monu
5 Replies

7. Shell Programming and Scripting

How to remove spaces using awk,sed,perl?

Input: 3456 565 656 878 235 8 4 8787 3 7 35 878 Expected output: 3456 565 656 878 235 8 4 8787 3 7 35 878 How can i do this with awk,sed and perl? (10 Replies)
Discussion started by: cola
10 Replies

8. Shell Programming and Scripting

Using sed (or awk or perl) to delete rows in a file

I have a Unix file with 200,000 records, and need to remove all records from the file that have the character ‘I' in position 68 (68 bytes from the left). I have searched for similar problems and it appears that it would be possible with sed, awk or perl but I do not know enough about any of these... (7 Replies)
Discussion started by: joddo
7 Replies

9. Shell Programming and Scripting

Delete Lines : after pattern1 and between pattern2 and pattern3 using awk/sed/perl

Hi I need to delete lines from a file which are after pattern1 and between pattern 2 and patter3, as below: aaaaaaaa bbbbbbbb pattern1 cdededed ddededed pattern2 fefefefe <-----Delete this line efefefef <-----Delete this line pattern3 adsffdsd huaserew Please can you suggest... (6 Replies)
Discussion started by: vk2012
6 Replies

10. Shell Programming and Scripting

sed delete leading spaces in a .csv if not in a string

Solaris, ksh I have a .csv file I am trying to clean up before loading into the database. The file contains comma separated columns that have leading spaces which I need to remove. The trouble is, some columns that should not be touched are strings which happen to have the same pattern in them. ... (4 Replies)
Discussion started by: gary_w
4 Replies
GETUNIMAP(8)							       Linux							      GETUNIMAP(8)

NAME
getunimap - dump the unicode map for the current console to stdout SYNOPSIS
getunimap [ -s ] [ -C console ] DESCRIPTION
The getunimap program is old and obsolete. It is now part of setfont (1). The getunimap program outputs the unicode map (also called a "Screen Font Map") for the current console to standard output. The -C option may be used with Linux 2.6.1 and later to get the map for a console different from the current one. Its argument is a path- name. The output of getunimap is of the form 0xAA U+1234 # comment where 0xAA is the font character code and U+1234 is a unicode character, that if displayed, will be displayed using glyph 0xAA in the font. Many unicode characters may be mapped to the same glyph. the Hash symbol # is used as a comment delimiter; characters after a hash sign (to the end of the line) are comments. The -s option will sort and merge elements, sorting on font character. Hence, it will produce output of the form: 0x22 U+1234 U+5678 U+3456 0x23 U+0023 etc., listing the multiple unicode characters that map to a font glyph. The output of getunimap is of the form accepted by setfont and psfaddtable SEE ALSO
psfaddtable(1), setfont(1). Console Tools 2004-01-01 GETUNIMAP(8)
All times are GMT -4. The time now is 03:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy