Input file contains Windows(DOS) line endings which are not supported

711 views
Skip to first unread message

Yidong Xia

unread,
Feb 17, 2016, 6:22:18 PM2/17/16
to moose-users
I got an input file from someone else (see attached). The problem when running it (no matter which app) is as below. I guess that guy created the input file on a Windows machine. And now I am on a Mac. How can I fix this input file?

Thanks,
Yidong 


*** ERROR ***
test_cube.i contains Windows(DOS) line endings which are not supported.
Stack frames: 8
0: 0   libmesh_opt.0.dylib                 0x0000000101509401 libMesh::print_trace(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) + 1457
1: 1   libmoose-opt.0.dylib                0x0000000100fbd384 MooseUtils::checkFileReadable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool) + 1060
2: 2   libmoose-opt.0.dylib                0x0000000100ea1f7c Parser::parse(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 252
3: 3   libmoose-opt.0.dylib                0x0000000100cb1ce0 MooseApp::setupOptions() + 3424
4: 4   libmoose-opt.0.dylib                0x0000000100cb3d6f MooseApp::run() + 15
5: 5   falcon-opt                          0x00000001009f34f2 main + 114
6: 6   libdyld.dylib                       0x00007fff8b62f5c9 start + 1
7: 7   ???                                 0x0000000000000003 0x0 + 3
[0] /Users/xia/gitprojects/moose/framework/src/utils/MooseUtils.C, line 98, compiled Jan 28 2016 at 16:27:43
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

test_cube.i

Andrew....@csiro.au

unread,
Feb 17, 2016, 6:24:13 PM2/17/16
to moose...@googlegroups.com

Try

 

dos2unix test_cube.i

 

a

 

 

Ph: +61 7 3327 4497.  Fax: +61 7 3327 4666
Queensland Centre for Advanced Technologies
PO Box 883, Kenmore, Qld, 4069 
 

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/1ea37dfd-4d69-4691-bac8-2c8304ef74eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cody Permann

unread,
Feb 17, 2016, 6:26:04 PM2/17/16
to moose...@googlegroups.com
That doesn't work on Macs

Try this:

perl -pi -e 'tr/\r//d' file.txt

Peterson, JW

unread,
Feb 17, 2016, 6:30:41 PM2/17/16
to moose-users
On Wed, Feb 17, 2016 at 4:25 PM, Cody Permann <codyp...@gmail.com> wrote:
That doesn't work on Macs

Try this:

perl -pi -e 'tr/\r//d' file.txt


Emacs has this insane command that I have definitely memorized:

M-x set-buffer-file-coding-system utf-8-unix

--
John

Cody Permann

unread,
Feb 17, 2016, 6:34:07 PM2/17/16
to moose-users
... And this is why Vi users make fun of Emacs users:

:set ff=unix

BTW - I'm an Emacs user so I can make this joke without offending anyone.


--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.

Derek Gaston

unread,
Feb 17, 2016, 11:44:03 PM2/17/16
to moose...@googlegroups.com
In Emacs I can't ever remember the command - so I just click the little "button" in the buffer that switches encoding type (it's actually the little ":" right next to the U).  When it says just "U:" it's using unix line endings... it will say "U(Dos)" if it's using DOS (Windows) line endings.  Just click it to toggle to the one you want.  Obviously!  ;-)



line_endings.png






Andrew....@csiro.au

unread,
Feb 17, 2016, 11:50:40 PM2/17/16
to moose...@googlegroups.com

To be honest i thought Derek was just joking in this email.  But no!  you truly can click that colon.  I had no idea!

 

a

 

 

Ph: +61 7 3327 4497.  Fax: +61 7 3327 4666
Queensland Centre for Advanced Technologies
PO Box 883, Kenmore, Qld, 4069 
 

Cody Permann

unread,
Feb 18, 2016, 9:33:12 AM2/18/16
to moose...@googlegroups.com
Yeah that's how many of use do it too for single files like this since that emacs command is ridiculous. If you have a list of files opening them all and using the mouse is a terrible solution so it's nice to have some of these one-liners in your arsenal to apply to directories of files. 

Reply all
Reply to author
Forward
0 new messages