Sponsored Content
Top Forums Shell Programming and Scripting Removing tab spaces at the end of each line Post 302953952 by am24 on Thursday 3rd of September 2015 01:49:34 AM
Old 09-03-2015
Thanks for replying Don.Sorry for late reply. I have executed the commands you suggested and here is the output from that.
Code:
uname -a
SunOS cvgsolsasp001 5.10 Generic_142900-06 sun4u sparc SUNW,SPARC-Enterprise

Code:
printf '%s\n' "$SHELL"
/bin/csh

Code:
od -bc headrec

0000060 061 065 060 062 062 011 061 065 060 062 062 011 061 065 060 062
           1   5   0   2   2  \t   1   5   0   2   2  \t   1   5   0   2
0000100 062 011 061 065 060 062 062 011 061 065 060 062 062 012 061 065
           2  \t   1   5   0   2   2  \t   1   5   0   2   2  \n   1   5

Code:
sed 's/[[:space:]]*$//' headrec | od -bc

0000060 061 065 060 062 062 011 061 065 060 062 062 011 061 065 060 062
           1   5   0   2   2  \t   1   5   0   2   2  \t   1   5   0   2
0000100 062 011 061 065 060 062 062 011 061 065 060 062 062 012 061 065
           2  \t   1   5   0   2   2  \t   1   5   0   2   2  \n   1   5

Kindly look into this once
Moderator's Comments:
Mod Comment Please use CODE tags for all sample input, all sample output, and all code segments.

Last edited by Don Cragun; 09-03-2015 at 03:32 AM.. Reason: Fix CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To Trim spaces at the end of line

Hi Friends, Can any one help with this issue: How to trim spaces for each line at the end, Like I have a file in this format. EMP1 SMITH 46373 5 STREET HOWARD 74636 EMP2 JONES 5454 { these are spaces ........} EMP3 SMITH 46373 5 STREET HOWARD 74636 EMP4 JON 2554 { these are... (1 Reply)
Discussion started by: sbasetty
1 Replies

2. Shell Programming and Scripting

to see space, tab, end of the line chracters

what can I use ?? In vi, I can use :set list <-- and see end of line $.. or use cat -A but I am wondering if there is command or program that allows me to see all the hidden characters( space, tab and etc) Please help thanks. (3 Replies)
Discussion started by: convenientstore
3 Replies

3. UNIX for Dummies Questions & Answers

how to append spaces(say 10 spaces) at the end of each line based on the length of th

Hi, I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is. I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies

4. Shell Programming and Scripting

Replace spaces between strings in a line with tab

Hi All I am having problem in substitution of any number of spaces, or a combination of space and tab in between strings in the lines of text file. Is there any way out in Perl? Please help me. e.g., Say the input is in the following format:- XX yyy zzz... (1 Reply)
Discussion started by: my_Perl
1 Replies

5. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: NARESH1302
3 Replies

6. Shell Programming and Scripting

Removing spaces in a line

Hi All, I have a line like this " field1;field2;field3 " (single space after and before double quotes). Now i have to remove these single space . Kindly help me. Thanks in advance (2 Replies)
Discussion started by: krishna_gnv
2 Replies

7. Shell Programming and Scripting

append end of line with 8 spaces

child_amt=$amount prev_line="$prev_line $child_amt" i am getting the result like this 21234567890001343 000001004OLFXXX029100020091112 0000060 but i want 8 spaces between the eg: 21234567890001343 000001004OLFXXX029100020091112 0000060 how can i do this in .ksh (1 Reply)
Discussion started by: kshuser
1 Replies

8. UNIX for Dummies Questions & Answers

Removing empty lines at the end of a Tab-delimited file

I'm trying to remove all of the empty lines at the end of a Tab delimited file. They have no data just tabs. I've tried may things, here are a couple: sed /^\t.\t/d File1 > File2 sed /^\t{44}/d File1 > File2 What am I missing? (9 Replies)
Discussion started by: SirHenry1
9 Replies

9. Shell Programming and Scripting

Adding tab/new line at the end of each line of a file

Hello Everyone, I need a help from experts of this community regarding one of the issue that I am facing with shell scripting. My requirement is to append char's at the end of each line of a file. The char that will be appended is variable and will be passed through command line. The... (20 Replies)
Discussion started by: Sourav Das
20 Replies

10. Shell Programming and Scripting

How to catch a two word keyword which may contain a new line(may include spaces or tab) in it?

How to catch a two word keyword which may contain a new line(may include spaces or tab) in it. for example there is a file a.txt. $more a.txt create view as (select from ......... .......... ( select .... ( select ...... .. select only no ((( number ( select end (12 Replies)
Discussion started by: neelmani
12 Replies
ISALNUM(3)						   BSD Library Functions Manual 						ISALNUM(3)

NAME
isalnum -- alphanumeric character test LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <ctype.h> int isalnum(int c); int isalnum_l(int c, locale_t loc); DESCRIPTION
The isalnum() function tests for any character for which isalpha(3) or isdigit(3) is true. The value of the argument must be representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' 064 ``4'' 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' 071 ``9'' 101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E'' 106 ``F'' 107 ``G'' 110 ``H'' 111 ``I'' 112 ``J'' 113 ``K'' 114 ``L'' 115 ``M'' 116 ``N'' 117 ``O'' 120 ``P'' 121 ``Q'' 122 ``R'' 123 ``S'' 124 ``T'' 125 ``U'' 126 ``V'' 127 ``W'' 130 ``X'' 131 ``Y'' 132 ``Z'' 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' 145 ``e'' 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i'' 152 ``j'' 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n'' 157 ``o'' 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s'' 164 ``t'' 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x'' 171 ``y'' 172 ``z'' The isalnum_l() function takes an explicit locale argument, whereas the isalnum() function uses the current global or per-thread locale. RETURN VALUES
The isalnum() function returns zero if the character tests false and returns non-zero if the character tests true. COMPATIBILITY
The 4.4BSD extension of accepting arguments outside of the range of the unsigned char type in locales with large character sets is considered obsolete and may not be supported in future releases. The iswalnum() function should be used instead. SEE ALSO
ctype(3), isalpha(3), isdigit(3), iswalnum(3), xlocale(3), ascii(7) STANDARDS
The isalnum() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The isalnum_l() function conforms to IEEE Std 1003.1-2008 (``POSIX.1''). BSD
July 17, 2005 BSD
All times are GMT -4. The time now is 04:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy