Sponsored Content
Top Forums Shell Programming and Scripting remove special character from a specific column Post 302525245 by ctsgnb on Thursday 26th of May 2011 07:00:57 AM
Old 05-26-2011
Code:
awk '{gsub("[0-9]*","",$1);gsub("[0-9]*","",$3)}1' infile.txt >newfile.txt

---------- Post updated at 12:57 PM ---------- Previous update was at 12:56 PM ----------

Code:
awk '{gsub("[0-9]*","",$2);gsub("[0-9]*","",$3)}1' infile.txt >newfile.txt

---------- Post updated at 01:00 PM ---------- Previous update was at 12:57 PM ----------

Alternately

Code:
awk '{gsub("[[:digit:]]",z,$2);gsub("[[:digit:]]",z,$3)}1' file.txt >newfile.txt

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove box like special character from end of string

Hi All, How to remove a box like special character which appears at the end of a string/line/record. I have no clue what this box like special character is. It is transparent square like box. This appears in a .DAT file at the end of header. I'm to compare a value in header with a parameter.... (16 Replies)
Discussion started by: Qwerty123
16 Replies

2. Shell Programming and Scripting

remove special character from a textfile

Can any one plse help me writing shell script to removing some special character pattern (like / > -------, / > / > ------- etc....as shown below) from the text file ASAP. / > ------- <tag-normalization tag-name="EXECSERVPRODUCT" read-only="false" part="body"> ... (3 Replies)
Discussion started by: bkc
3 Replies

3. Shell Programming and Scripting

Remove special character ($) from file names

Hello I've searched here and on the 'net for examples of a script or command line function that will remove the $ character from all file names only that can be done within the directory that contains the file names - which are all html files. ie, I have a directory that contains html files... (6 Replies)
Discussion started by: competitions
6 Replies

4. Shell Programming and Scripting

sed or tr to remove specific group of special characters

Hi, I have a input of the form: ..., word1, word2, word3... I want out put of the form word1, word2, word3 I tried echo '..., word1, word2, word3...' | tr -d '...,' but that takes out the commas in the middle too so I get word1 word2 word3 but I want the commas in the middle. ... (3 Replies)
Discussion started by: forumbaba
3 Replies

5. Shell Programming and Scripting

Remove some special ascii character

Hello I have this special caracter after retreving rows from sql server: "....spasses: • Entrem al valort 6050108002811 • El donem..." I would like a sed command to remove it..or just know it's ascii code in order to replace it into my sql sentence.. Hope some one knows how to do that.... (7 Replies)
Discussion started by: ldiaz2106
7 Replies

6. Shell Programming and Scripting

Remove the first character from the fourth column only if the column has four characters

I have a file as follows ATOM 5181 N AMET K 406 12.440 6.552 25.691 0.50 7.37 N ATOM 5182 CA AMET K 406 13.685 5.798 25.578 0.50 5.87 C ATOM 5183 C AMET K 406 14.045 5.179 26.909 0.50 5.07 C ATOM 5184 O MET K... (14 Replies)
Discussion started by: hasanabdulla
14 Replies

7. Shell Programming and Scripting

Remove blank space and insert special character

Hi Folks, I have a huge data of the below format abc #apple 1200 06/23 ghj #orange 1500 06/27 uyt #banana 2300 05/13 efg #vegetable 0700 04/16 After first 3 letters, i have 9 spaces and after fruit there are no specific fixed space, but it varies... (4 Replies)
Discussion started by: jayadanabalan
4 Replies

8. Shell Programming and Scripting

awk command to find total number of Special character in a column

How to find total number of special character in a column? I am using awk -f "," '$col_number "*$" {print $col_number}' file.csv|wc -l but its not giving correct output. It's giving output as 1 even though i give no special character? Please use code tags next time for your code and... (4 Replies)
Discussion started by: AjitKumar
4 Replies

9. Shell Programming and Scripting

Text to column starting/ending with special character in each row

Hello, Here is my text data excerpted from the webpage: input My target is to get: What i tried is: sed 's/.*\(connector\)/1/' input > output but all characters coming before the word "connector" are deleted which is not good for me. My question: (9 Replies)
Discussion started by: baris35
9 Replies
CLIT(1) 						      General Commands Manual							   CLIT(1)

NAME
clit - program to manipulate Microsoft Reader .LIT files SYNOPSIS
1. clit [options] litfile.lit subdir/ 2. clit [options] oldfile.lit newfile.lit 3. clit [options] oldfile.lit newfile.lit inscription DESCRIPTION
This manual page documents briefly the clit command. ConvLIT is a program to convert Microsoft Reader format eBooks [LIT] into an open format. clit supports three modes of operation: 1. Explosion: expanding a LIT file into an OEBPS compliant package, that is the original XML / HTML source. 2. Downconverting: converts to DRM1 format, also known as sealing the LIT file. 3. Inscribing: similar to #2, this adds a label, or inscription, to the ebook to mark that it belongs to you. OPTIONS
A summary of options is included below. For a complete description, run the program without any arguments. -d Disable creating multiple subdirectories. -h Show summary of options. -k /path/to/keys.txt The DRM5 key file is assumed to be called keys.txt and located in the current directory. If not, use this option to instruct Con- vLIT where to find the key file. AUTHOR
ConvLIT was written by Dan A. Jackson <drs@convertlit.com>. This manual page was written by Joe Nahmias <jello@debian.org>, for the Debian project (but may be used by others). March 23, 2008 CLIT(1)
All times are GMT -4. The time now is 04:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy