Mercurial > repos > iuc > dos2unix
view dos2unix.xml @ 0:0b3a28ad3947 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/dos2unix/ commit 7e66ed2b5a95d5d1523524e5dc106bd9d4cb6b43
author | iuc |
---|---|
date | Fri, 11 Jul 2025 11:20:26 +0000 |
parents | |
children |
line wrap: on
line source
<tool id="dos2unix" name="Text file format converters (dos2unix)" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE_VERSION@"> <description> Convert text files with DOS or Mac line breaks to Unix line breaks and other text cleaning options. </description> <macros> <import>macros.xml</import> </macros> <edam_topics> <edam_topic>topic_3572</edam_topic> </edam_topics> <edam_operations> <edam_operation>operation_0335</edam_operation> </edam_operations> <expand macro="requirements"/> <command detect_errors="exit_code"><![CDATA[ #if $info dos2unix --info $mac_mode '$input_file' > '$output_file' #else dos2unix --newfile --safe $add_end_of_line $mac_mode $bom '$input_file' '$output_file' #end if ]]></command> <inputs> <param name="input_file" format="txt,tsv,csv,tabular" type="data" label="The input file to convert to Unix format"/> <param name="add_end_of_line" type="boolean" truevalue="--add-eol" falsevalue="--no-add-eol" checked="true" label="Add (or don't add) a line break to the last line if there isn't one."/> <param name="bom" type="boolean" truevalue="--remove-bom" falsevalue="--keep-bom" checked="true" label="Remove Byte Order Mark (BOM). Do not write a BOM in the output file."/> <param name="mac_mode" type="boolean" truevalue="-c mac" falsevalue="" checked="false" label="Run in Mac Mode." help="By default line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted. In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed."/> <param name="info" type="boolean" truevalue="--info" falsevalue="" checked="false" label="Display file information. No conversion is done." help="The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name."/> </inputs> <outputs> <data name="output_file" format="txt"/> </outputs> <tests> <test expect_num_outputs="1"> <param name="input_file" value="censored.txt"/> <param name="add_end_of_line" value="false"/> <param name="bom" value="false"/> <param name="mac_mode" value="false"/> <param name="info" value="true"/> <output name="output_file"> <assert_contents> <has_text text="UTF-8"/> </assert_contents> </output> </test> <test expect_num_outputs="1"> <param name="input_file" value="censored_no_bom.txt"/> <param name="add_end_of_line" value="false"/> <param name="bom" value="false"/> <param name="mac_mode" value="false"/> <param name="info" value="true"/> <output name="output_file"> <assert_contents> <has_text text="no_bom"/> </assert_contents> </output> </test> <test expect_num_outputs="1"> <param name="input_file" value="censored.txt"/> <param name="add_end_of_line" value="true"/> <param name="bom" value="true"/> <param name="mac_mode" value="false"/> <param name="info" value="false"/> <output name="output_file" file="censored_no_bom.txt"/> </test> </tests> <help><![CDATA[ This tool can be used to convert files in DOS or Mac format to Unix format. In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks. ]]></help> <citations> <expand macro="citations"/> </citations> </tool>