11-11-2012
dos2unix , unix2dos
Quote:
Originally Posted by
abhi_123
Hi All,
I need to remove control m character from a file.
Steps which i am doing in shell script are:
1) We are comparing the header of the file to the database table header
Here the file header has control-m characters. How do i remove it.
Please help. Below are the steps i am using, but is not working out.
v_header=`sed 1q $v_sftphomedir/$v_finalsourcefile`
echo $v_header |tr -d '\015' > v_avilableheader
or
sed 's/^M//g' $v_header
Please help.
Hello,
If you copy a file created or modified in Windows or DOS to a Linux/Unix file system, you sometimes find ^M characters at the end of each line.
try to use dos2unix / unix2dos.
Regards
Last edited by bdittmar; 11-11-2012 at 12:13 PM..
Reason: Add line
10 More Discussions You Might Find Interesting
1. Programming
What is the best method to identify an remove control characters in a file. Would it be easier to do this in Unix or in C. (0 Replies)
Discussion started by: oracle8
0 Replies
2. Shell Programming and Scripting
Anyone know how to remove ^M's from a text file using sed command? (6 Replies)
Discussion started by: djkane
6 Replies
3. Shell Programming and Scripting
Hi..
I have a perl program that uses "system" to execute a shell script called startengine. The script "startengine" itself calls a lot of other smaller scripts to setup the engine etc. It finally has to execute ./engine which is another shell script which is long and takes a long time to... (3 Replies)
Discussion started by: JLJ
3 Replies
4. Shell Programming and Scripting
Hi All,
Now i am running the 3 oracle procedures one by one manually.
Query: If 1st Procedure OUT_PUT is Success, then call 2nd Procedure.
If 2nd Procedure OUT_PUT is Success, then call 3rd Procedure.
If 1st Procedure is failed, then no need of calling the other
... (8 Replies)
Discussion started by: hanu_oracle
8 Replies
5. Shell Programming and Scripting
hi i'm new to shell scripts and have a small problem
i am running a batch converter that returns all flash .flv files in a directory and create a png image from each one
the problem i have is the $1 variable , its ok on the first call but on the secound call $1.png , i have extra... (1 Reply)
Discussion started by: wingchun22
1 Replies
6. Shell Programming and Scripting
I have a browser running in a separate virtual terminal and would like to be able to send shortcut codes (e.g. ctrl+A) to the browser (and have it react) from a bash script in a separate virtual terminal. I need to keep the script in the separate virtual terminal. (2 Replies)
Discussion started by: slak0
2 Replies
7. Shell Programming and Scripting
Version Control Through the Shell Script
Hi Guys,
Apologize for the big request, please take some time and read it completely... This is Very important for me, and ur help is Very much Appriciated.
I want to maintain the Version control to all my scripts running in Production server, I am... (6 Replies)
Discussion started by: Anji
6 Replies
8. Shell Programming and Scripting
I have developed a small script to remove the Control M characters that get embedded when we move any file from Windows to Unix. For some reason, its not working in all scenarios. Some times I still see the ^M not being removed. Is there anything missing in the script:
cd ${inputDir}... (7 Replies)
Discussion started by: vskr72
7 Replies
9. Shell Programming and Scripting
sed -e "s// /g" old.txt > new.txt
While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies
10. UNIX for Dummies Questions & Answers
I found a closed thread that helped quite a bit. I tried adding the URL, but I can't because I don't have enough points... ?
Modifying the syntax to remove ! ~
find . -type f -name '*~\!]*' |
while IFS= read -r; do
mv -- "$REPLY" "${REPLY//~\!]}";
done
These messages are... (2 Replies)
Discussion started by: rabidphilbrick
2 Replies