Anyone have a shell script to remove controlM character from all the files in a directory
Dev_9 0 Newbie Poster
Recommended Answers
Jump to PostEasily done, but what do you do if the folder contains an executable or an image file?You don't want to delete ^M in those.
Jump to PostForgot to ask. Is this for Windows or for linux? I would imagine linux or there would be no need to strip cr but you never know.
Jump to PostIn that case you can run the following script on Windows. Copy the code into a file,
stripcr.vbs
. Run it in the current folder by specifying the file extensions that you want to process likestripcr cpp h txt
. Note that if you haven't previously done
Jump to PostAlso note that if you run stripcr against an exe you WILL destroy it.
All 14 Replies
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Dev_9 0 Newbie Poster
John_191 15 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Dev_9 0 Newbie Poster
John_191 15 Newbie Poster
Dev_9 0 Newbie Poster
Dev_9 0 Newbie Poster
John_191 15 Newbie Poster
Dev_9 0 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
John_191 15 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.