i am facing issue while reading files in unix, which has ^J at end of every line. I want to know how to replace it in the file.
Example: infile.txt has below data
-----------------
20101030^J
110
Now in the above file i want unix command to replace the ^J character . so that i will use in my script for source files to replace the '^J' character.
I am New bee to Control Characters. Dont know how to deal with them. Please help me in fixing this.
When dealing with characters, that are not easy to type in an editor, I usually find the "offending" character with od. od can be found on most *nixes, and supports multiple ways to display it's input.
Here are a few examples. First I created some arbitary data:
I have done the file ftp and place it in AIX box. Now i am surprised with the source file... it is not showing any special character in the file when i opened through vi. but when i have given the command tail -1 input.txt.. it is not giving the last line , it is giving all the two lines from the source file.
file inut.txt:
-----------
20101021
1023
Below is the output after giving the command tail -1 input.txt:
20101021
1023
it is displaying all the lines from the source file . I am shocked tat why it is happening even though there is no special character visible in the file.
How to fix this. and identify the special character.
Please suggest how to fix it
Thanks In Advance
kk
Quote:
Originally Posted by ikki
When dealing with characters, that are not easy to type in an editor, I usually find the "offending" character with od. od can be found on most *nixes, and supports multiple ways to display it's input.
Here are a few examples. First I created some arbitary data:
My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data.
... (7 Replies)
Hi All,
I am having a file like below
01098546 3 56120610010377101008311121 001382 71 003 5011339
01099413 1 42120500010247081106112121 000304 46 002 2011339
I want to replace the 78 column from 3 to 4 and I need the file as below
01098546 ... (1 Reply)
Replace first 3 characters in a unix file (say replace "A&B" with "C&D") in all lines of the file. Need a sed or awk script to do this. Kindly help!
-Kumar (4 Replies)
I have a Logging.xml file located on my laptop c: drive. I want to take this file and replace the Logging.xml that is currently on my Aix 6.1 Unix server with it.
Here is the where the file is located. It is the Logging.xml file
... (8 Replies)
Search and Replace a string pattern with empty in an xml file in unix:
My xml file would be like this :
<Accounts><Name>Harish</Name><mobile>90844444444444445999 </mobile><TRIG>srcujim-1</TRIG></Accounts><Accounts><Name>Satish</Name><mobile>908999</mobile><TRIG>ettertrtt-1</TRIG></Accounts>
... (1 Reply)
I have a data file having first 19 characters having the date in the below format-
2010-04-29-00.00.00
I have to check this date field ( first 19 characters) against some specific dates and if date is not in 3 valid dates ( business date available to me , business date - 1 , businessdate... (10 Replies)
Hi
Am getting "Line too long" error in opening a file using vi editor but it is opening using cat.
How can i edit the file to replace some string in it.
Thanks (5 Replies)
HI
can any one tell me how to replace a delimiter : with another delimiter '\001' it is a non printable octal character.
thanks in adv
spandu (4 Replies)
Hi Friends,
well what i want to do is that suppose i have a file say like
....
ronaldduckdancecoolman
donaldmuckdancepooltactics
fonaldguckdancetoolbutcomps
....
okok i agree this is a ridiculous data for a file.
:-)
now i want that the characters in each line fromposition 16 to say 19... (6 Replies)