|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Problem with Special characters in file
Hi, I am facing a below problem. Inorder to mak sure the below file is fixed width i am using the following command Code:
awk '{printf("%-375s\n", $0) }so as to add trailing spaces at the end for records of length less than 375. Input file > inp.txt Code:
1©1234 1234 123©1 The output file is fixed with of expected length but the data after the © is getting lost is getting padded spaces. Output: 1<space till 375> 1234<space till 375> 123<spacetill 375> Can you please let me know as to how to avoid this and of there is a better way to make the records in a file fixed width?
|
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
What encoding is this? Your copyright character may end up being several bytes, even though it's a single character, which awk's formatting won't take into account.
In fact, if this file really is supposed to be fixed width, the presence of a character like that may be a problem altogether. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to tail file; problem with awk and special characters | moo72moo | Shell Programming and Scripting | 2 | 01-24-2012 01:42 PM |
| special characters giving problem | sam25 | Shell Programming and Scripting | 6 | 09-09-2009 02:08 PM |
| utf-8, problem with special characters | alina | HP-UX | 3 | 09-26-2008 04:38 AM |
| Removing special characters in file | srivsn | Shell Programming and Scripting | 6 | 01-03-2008 05:10 AM |
| how to see special characters in a file using vi | jingi1234 | UNIX for Dummies Questions & Answers | 6 | 10-19-2005 11:57 AM |
|
|