Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:28:08+00:00 2026-05-10T20:28:08+00:00

Question says it all, I’ve got a 500,000 line file that gets generated as

  • 0

Question says it all, I’ve got a 500,000 line file that gets generated as part of an automated build process on a Windows box and it’s riddled with ^M‘s. When it goes out the door it needs to *nix friendly, what’s the best approach here, is there a handy snippet of code that could do this for me? Or do I need to write a little C# or Java app?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:28:08+00:00Added an answer on May 10, 2026 at 8:28 pm

    Here is a Perl one-liner, taken from http://www.technocage.com/~caskey/dos2unix/

    #!/usr/bin/perl -pi s/\r\n/\n/;

    You can run it as follows:

    perl dos2unix.pl < file.dos > file.unix 

    Or, you can run it also in this way (the conversion is done in-place):

    perl -pi dos2unix.pl file.dos 

    And here is my (naive) C version:

    #include <stdio.h>  int main(void) {    int c;    while( (c = fgetc(stdin)) != EOF )       if(c != '\r')          fputc(c, stdout);    return 0; } 

    You should run it with input and output redirection:

    dos2unix.exe < file.dos > file.unix 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The question says it all. I am looking for a build.xml file browser where
The question says it all. I understand that VC11 is currently only in beta,
The question says it all. How do I let the users download a file
i think the question says it all, but I have an application that uses
Question says it all. I want C function call that returns the list the
The question says it all really. I'm hoping that I don't have to write
The question says it all. I realize that all options do work in up-to-date
The question says it all. My jquery autocomplete gets its source from one of
the question says it all. Are there PDF documents that contain images with different
Question says it all - is there a class somewhere in Windows Forms that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.