News:

alphaMELTS 1.9 is available at the download and information site.
alphaMELTS 2 standalone & for MATLAB/Python are available on request
(see the Version 2 tab on the download site for more details).
For news of all MELTS software see the MELTS Facebook page.

Main Menu

[FAQ] Fixing line ending issues with file-format.command

Started by Paula, November 18, 2020, 11:11:04 AM

Previous topic - Next topic

Paula

alphaMELTS 2 is currently a little more sensitive to whether the line endings are correct for the operating system (Mac/Linux versus Windows) than alphaMELTS 1.9 was. On Windows it will help avoid line ending problems if the versions of alpahMELTS 2, easyMelts, and alphaMELTS for MATLAB/Python are all the same i.e. all native Windows, or all Windows Subsystem for Linux. That may not be possible and anyway downloaded files or files that you are sent may have the opposite line endings to what you need.

If alphaMELTS fails to read all lines in one of your input files, fixing the line endings might solve the problem. To do this we provide a Perl script, file-format.command, that is installed at the same time as run-alphamelts.command.

Running install2.command on Linux / Mac will automatically update the line endings of all .command scripts and run-alphamelts.command will fix the line endings of any files passed to on the command with (e.g. '-m my.melts'). Note that downloaded example files will generally have Windows line endings.

If alphaMELTS is installed correctly you should be able to open the terminal, navigate to where your input files are and type something like this:
Quote
file-format.command melts_files
... where melts_files is a list of .melts files.
file-format.command *.melts *.txt
... where * is a wildcard that means all .melts and .txt files in the current directory will be processed
You should see a list of "Processed melts_file" type messages, one for each file.

If you just type "file-format.command" or if you double-click the file-format.command link in the links_folder (usually "~/bin" or "~/Documents/bin", where '~' means your user home space) then you can add a list of files to be processed once the script starts. You can drag and drop the files from Finder, Explorer or another file manager. (The '*' wildcard will not work in this case, though.)

For more information on dragging and dropping files onto the command see the "Interactive Operation" section of the old alphaMELTS online manual (click here to go to that section on a no-frames page).