As you suggested,Please see the sample data below replaced from actual data
Thanks
Rakesh Puli
Thank you. That is a good start.
We now know that your input looks like what you described in post #1 in this thread and that it does not look like what you described on post #10 (where there were 20 fields and two of those fields were to be changed) and it does not look like what you described in post #13 (where there were 4 fields and absolutely nothing was supposed to be changed) and it does not like what you described in post #17 update 1 (where there were 16 fields).
In addition to the number of fields changing, your description of what characters are to be considered "special" seems to vary from post to post.
If what you want to do is:
remove all adjacent special characters at the end of each record,
where a character is considered special if it is not a numeric character and it is not a <space> character,
the data you want to process is located in a file named file, and
you want the results of the above conversion to be written to standard output
then the following command should do what you want:
This will not be sufficient if any other field is to be modified and it will not be sufficient if any other character is not to be treated as special.
Since you still have not shown us what output you hope to produce from the above sample input, we have no way of knowing which of your many different statements about what changes are to be made is the correct set of requirements. The above code produces the output:
Note that the above output include a single <space> character at the end of each line.
Last edited by Don Cragun; 02-06-2019 at 05:06 PM..
Reason: Add note.
This User Gave Thanks to Don Cragun For This Post:
We have a unix file that contains special characters (ie. Ñ, °, É, ¿ , £ , ø ). When I try to read this file I get a codepage error and the characters are replaced by the # symbol. How do I keep the special characters from being read?
Thanks.
Ryan (3 Replies)
I don't now exactly how I did it, but I created a file named " -C "
cexdi:/home1 $ls -lt
total 1801336
-rw------- 1 cexdi ced-group 922275840 23 mars 10:03 -C
How do I delete this file ?
cexdi:/home1 $rm -C
rm: invalid option -- C
Syntax : rm filename ...
Doesn't work...... (5 Replies)
Hi all,
I have the following lines
<b>A gtwrhwrthwr text hghthwrhtwrtw </b><font color='#06C'>; text text (text)
<b>B gtwrhwrthwr text hghthwrhtwrtw </b><font color='#06C'>; text text (text)
<b>J gtwrhwrthwr text hghthwrhtwrtw </b><font color='#06C'>; text text (text)
and I would like to... (5 Replies)
Hello Team,
Any one suggest how to delte the below special character from a file which is having one column 10 rows of same below content.
----------------------------------------
Kosten|bersicht gemd_ ' =Welche Kosten kvnnen... (2 Replies)
I have a file that has the name in one of the lines as MARíA MENDOZA in Windows. When this gets FTPed over to UNIX it appears as MAR�A MENDOZA. Is there anyway to overcome this? Its causing a issue because the file is Postional and fields are getting pushed by 2 digits..
Any help would be... (4 Replies)
Need unix commands to delete records from one file if the same record present in another file...
just like join ... if the record present in both files.. delete from first file or delete the particular record and write the unmatched records to new file..
tried with grep and while... (6 Replies)
Hi,
How to add trailer record at the end of the flat file in the unix ksh shell scripting
can you please let me know the procedure
Regards
Srikanth (3 Replies)
Any time I do :
ls *.txt > mytext.txt
I get something like this in the output file:
^
Tue Jan 22 16:19:19 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
t1Fam_BrOv :~>alias | grep ls
alias l.='ls -d .* --color=tty'
alias lR='ls -R'
alias la='ls -Al'
alias lc='ls -ltcr'
alias ldd='ls -ltr |... (5 Replies)
My sed is not working on deleting the entire special characters and leaving what is necessary.grep connections_per a|sed -e 's/\<\!\-\-//g'
INPUT:
<!-- <connections_per_instance>1</connections_per_instance> -->
<method>HALF</method>
<!--... (10 Replies)