---------- Post updated at 01:09 PM ---------- Previous update was at 12:58 PM ----------
Quote:
Originally Posted by pankaj_tarale
Hi ,
For removing CTRL ^M character you need to user below commands
For Vi editor
%s/^M//g
By sed command
sed 's/^M//g' <filename>
Another way by tr command tr -d '\r' <filename>
Hope you are looking for the same.
-pankaj
Thanks pankaj
i have to remove junk character from the file through a shell script .
and this script runs daily and thus we receive 100 of files .
I assume that we can not use the vi edit in shell script.
can you please tell some other way to remove these junk characters ..
---------- Post updated at 01:19 PM ---------- Previous update was at 01:09 PM ----------
Quote:
Originally Posted by pankaj_tarale
Hi ,
For removing CTRL ^M character you need to user below commands
For Vi editor
%s/^M//g
By sed command
sed 's/^M//g' <filename>
Another way by tr command tr -d '\r' <filename>
Hope you are looking for the same.
-pankaj
I am getting the correct populated file now .
first i have removed the control m characters and then i applied the awk command to get the correct data
thanks
Last edited by Franklin52; 05-18-2012 at 10:12 AM..
Reason: Code tags
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
hay
i am trying to get JUST the PID from the ps command.
my command line is:
ps -ef | grep "mintty" | cut -d' ' -f2
but i get an empty line. i assume that the delimiter is not just one space character, but can't figure out what should i do in order to do that.
i know i can use awk or cut... (8 Replies)
Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from... (2 Replies)
Hi
I am using 'find' on a particular directory which has some subdirectories too,so when I search for .txt files from the parent directory, it gives all files that matches the pattern in the parent aswellas in the sub directories .
eg:
Iam at /a/b/c
where c has many other directories in it ... (7 Replies)
Hi guys,
I have a line of digits with no delimiters (but fixed record length for each fields). for example
aaaa1234bbbb
field 1 is 4 digit long, field 2 is 4 digit long and so on.
I need to cut fields 1 and 3, and while outputting I need a delimiter between the fields.
I can cut... (3 Replies)
Gurus,
I need help with the cut command :
I have a file with garbage charaters at the beginning of each record; but these characters are not of the same length;
First record has 3 garbage chars to be removed; rest have 2;
If the length was consistent across all the records, I could have... (3 Replies)
Hi All,
Can anyone tell me how to use cut command?I have tried but its not working...Please find the details below :
$ cat file1
SlNo. E_ID E_Name Age Dept
1 123 A 20 Electrical
2 124 B 20 Electronics
3 125 C 24 Computer
4 126 D 23 Mechanical
... (3 Replies)
I have a person running a perl script that is parsing > 2G log files and pipes to cut -d " " -f 1,6,7,8...
The script itself is in a nfs mounted home directory. It runs fine when started from a solaris 8 box but fails after about 400 lines when started from the solaris 10 box. The solaris... (1 Reply)
I have a list of files in a directory that I want to check position 2-6 for a string of EPIP or EPCN. I ran the following command but it isn't working correctly:
ls EPDa*.*.*.data |cut -c1-30
All it is doing is cutting the file name not what is in the file. Any help would be appreciated. (3 Replies)