Sponsored Content
Top Forums Shell Programming and Scripting How To replace Control-M in all files in a folder Post 302122997 by Shell_Life on Friday 22nd of June 2007 11:36:58 AM
Old 06-22-2007
Code:
sed 's/^M//g' input_file > $$Temp
mv $$Temp input_file

Where '^M' is entered as 'ctl-V' and 'ctl-M'.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace string in all files in a folder and subfolders.

i need to change string in all files in current folder and all subfolders. i wrote the following script. It works good except it dont delete temp file from subfolders. for z in `find . -type f -name "*.html" -o -name "*.htm"`; do sed -e 's@abc@xyz@g' $z>temp; mv temp $z; done any idea?... (1 Reply)
Discussion started by: crazynups
1 Replies

2. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

3. Shell Programming and Scripting

Replace control m

Hi I want to find ^M characters in all files in dir and subdirectory and replace . In single file use this and change ,how can i cahnge in files under subdirectory. perl -i -pe 's/^MZ//g' *.txt sed -e 's/^M//g' filename >filename.new Thanks in advance MR (2 Replies)
Discussion started by: mohan705
2 Replies

4. Shell Programming and Scripting

Find and replace folder of files with $var

I want to scan through all the files in the folder and replace all instances of $file_X within the file with the variable $X defined in my bash script on my debian 6.0 install. For example, if the file contains $file_dep I want it to be replaced with the value of the variable $dep defined in my... (1 Reply)
Discussion started by: Spadez
1 Replies

5. Shell Programming and Scripting

Replace character in files of entire folder? sed? or what?

Hello, I do have several files in one folder each file contains measurement data. for each file I would like to replace the character "," by "." ? How can I do this and how can I do this for each file at once? E.G. data_1.dat, data_x.dat (original version) data_1out.dat, data_x_out.dat... (10 Replies)
Discussion started by: rollinator
10 Replies

6. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

7. Shell Programming and Scripting

How to replace the first and last character which is pipe symbol in all files within a folder?

with in my files i have the data like this, starting with a pipe and ending the line with a pipe. all i want is to replace the first and last pipe , remove those trying to use following sed command, but it is only showing on the screen the entire data of the file as if it removed, but when i... (4 Replies)
Discussion started by: cplusplus1
4 Replies

8. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

9. Shell Programming and Scripting

Using sed command to replace "|" with ^ for all *.dat files in a folder not working

I am trying to use the below sed command to replace all "|" to ^, in a folder had 50 dat files. when i tried with 1 file it worked but when i tried with wild card, is not working. sed -i 's/"|"/\^/g' *.dat Is this the proper way to use sed command thank you very much for help. (3 Replies)
Discussion started by: cplusplus1
3 Replies

10. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies
rpdump(1)						      General Commands Manual							 rpdump(1)

NAME
rpdump - alpine remote data utility SYNTAX
rpdump [ -f ] -l Local_file -r Remote_folder DESCRIPTION
Rpdump may be used to copy the actual data from remote Alpine configuration files or address books into a local file. It is intended to be used by system administrators. Regular users should normally use the facilities provided within Alpine. Local_file will normally be a local temporary file. Remote_folder is the IMAP folder being used as a remote Alpine configuration (with the help of Alpine's -P, -p, and -x commands or PINECONF, PINERC, and PINERCEX environment variables) or remote Alpine address book folder. A copy of the data from Remote_folder will be copied to Local_file. -f Force the dump even if the remote folder is in an unrecognized format. -l Local_file The file on this system that is to be copied to. -r Remote_folder A remote folder name to be copied from. See the Alpine documentation for the syntax of a remote folder name. One example is {my.imap.server}remote_pinerc. DIAGNOSTICS
Exit status is zero if all goes well, -1 otherwise. SEE ALSO
Rpload(1). Copyright 1989-2007 by the University of Washington. $Date: 2005/01/14 20:40:14 $ rpdump(1)
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy