removing special characters, white spaces from a field in a file
what my code is doing, it is executing a sql file and the resullset of the query is getting stored in the text file in a fixed format. for that fixed format i have used the following code::
Code:
now 5th filed is a phone number. in the database it contains brackets like (0124)-23456
but in the file the output should be like 012423456
Could you please help????
Last edited by Franklin52; 08-04-2009 at 10:32 AM..
Reason: adding code tags
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
I am trying to remove whitespaces from a file containing sample data as:
457 <EOFD> Mar 1 2007 12:00:00:000AM <EOFD> Mar 31 2007 12:00:00:000AM <EOFD> system <EORD> 458 <EOFD> Mar 1 2007 12:00:00:000AM<EOFD>agf <EOFD> Apr 20 2007 9:10:56:036PM <EOFD> prodiws<EORD> . Basically these... (11 Replies)
Running SunOs 5.6. Solaris.
I've been able to remove all special characters from a fixed length file which appear in the first column but as a result all subsequent columns have shifted to the left by the amount of characters deleted.
It is a space separated file. Line 1 in input file is... (6 Replies)
Hello All ,
1. I am trying to do a task where I need to remove Blank spaces from my file , I am usingawk '{$1=$1}{print}' file>file1Input :-
;05/12/1990 ;31/03/2014 ;
Output:-
;05/12/1990 ;31/03/2014 ;This command is not removing all spaces from... (6 Replies)
I have a .CSV file when I check for the special characters in the file using the command cat -vet filename.csv, i get very lengthy lines with "^@", "^I^@" and "^@^M" characters in between each alphabet in all of the records. Using the code below file filename.csv I get the output as
I have a... (2 Replies)
Using awk or sed, I'd like to remove leading spaces after a comma and before a right justified number in field 6. Sounds simple but I can't find a solution. Each field's formatting must stay intact.
Input:
40,123456-02,160,05/24/2012,02/13/1977, 10699.15,0
Output:... (5 Replies)
Dear Gurus
Can you please advise me on how to Replace all TAB characters with white spaces in a text file in AIX?
Either using vi or any utilities (2 Replies)
Hi,
I have a file that contains whitespaces with spaces and spaces and tabs on each line and am wanting to remove the whitespaces. My version of sed is one that does not recognize \t etc.
The sed and awk one-liners below that I found via Google both does not work.
So my next best... (3 Replies)
'String' file contains the following contents,
D11, D31, D92, D29, D24,
using ksh, I want to remove all white spaces between characters no matter how long the string is.
Would you please give me some help? (1 Reply)
Anybody can help me
How can I replace only four first white spaces with , or any other characters
aaaa 08/31/2004 08/31/2009 permanent Logical Processors in System: 64
bedad 08/16/2001 08/15/2011 permanent Logical Processors in System: 64
badnv14 05/31/2008 05/30/2013 permanent Logical... (5 Replies)
I have file special.txt with the following data.
<header info>
123$ty5%98&0asd
1@356fgbv78
09*&^5jkns43(
...........some more rows.
In my output file, I want to eliminate all the special characters in my file and I want all other data. need some help. (6 Replies)