I have some data that must have been two lines at some point. If the string in one cell is longer than 78 characters, the 79th character is a blank space. This was probably a return that was converted to a space somewhere along the line. This data is processed by some code that replaces blank spaces with underscrore. The result is an underscore at the 79th position that does not belong there.
For example:
N-{[3,4-dihydroxy-5-(hydroxymethyl)oxolan-2-yl]amino}(2-hydroxyphenyl)carboxam_ide
These files have tens of thousands to hunderds of thousands of rows, so this definately calls for a script. Is there a way I can check the 79th character of each string and if it is _, delete it? I can copy the column to a file if that would be easier, otherwise I will have to tell the script which column to process.
Here is a short sample of one of the columns that I need to process:
If the string is <79 characters, it can be skipped.
Search for 78 instances of any character (and remember it), followed by an underscore, and remember the rest of the line.
If found, it will be replaced by the 2 remembered patterns, leaving the underscore out.
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Hi there,
A total sed noob here. Is there a way using sed to delete everything before a character AND after another character on each line in a file? The deletion should also delete the indicating characters(here: an opening and a closing parenthesis).
The original file would look like... (3 Replies)
Hello
is there a way to delete all symbolic characters using the tr command
or delete everything apart from letters
for example
input="u;'#n]
i would like echo $input to be "unix"
or a way to only accept letters
PLEASE HELP:wall: (4 Replies)
Hi all
I am trying to get my head around doing the following....
I have an input field that could contain either a number a blank field or a whitespace field.
What I want to do is delete a 0 (zero) if it's on its own or leading the number.
So:-
\t0 delete the zero
0 delete the... (8 Replies)
Friends, I'm looking for a command that delete the first tho caractere in a word. Here is an exp :
I want to replace "20091001" by "091001"
or "replace" by "place"
Thx, (13 Replies)
Hi,
I have a .txt and I need to delete the characters betwwen the 10th and 20th...
How can I do that...
I need to do somethink like these:
%s/I don't know how to define a range between 10th and 20th character//g
Can you help me...
If I want the 10 first characters i do this:... (2 Replies)
I built a 12 million record file and made a mistake, one field is 1 character too long.
The record is 40 bytes and ends always in 999. I am trying to delete the 37 character in each record. Is this possible without doing a cut and paste. (1 Reply)
Hi,
T think this is a question for Perderabo.
If you think you know the answer you must be very good ! :)
Most of us know how the make the <backspace> key backspace a character.
Now how do I make the <delete> key delete a character.
!! So when I press the delete key the character after... (3 Replies)
Hi ! All,
I have to delete first 2 characters from string. How its possible?
Like string value is "2001". I required output as "01"
Plaese help me.
Nitin (4 Replies)