frame .f1
pack .f1 -side top -fill x -padx 3 -pady 4
## Author:  Mark Hilstad
## MIT Space Systems Laboratory
## Copyright (c) 2001 Massachusetts Institute of Technology

## Reads in text file and changes the end-of-line character to
## the standard eol for the chosen platform

label .f1.msg -text "Translates text file newlines to desired platform"
pack .f1.msg -fill x

frame .f2
pack .f2 -side top -fill x -padx 3 -pady 4
button .f2.get -text "Load File:" -width 12 -command {
	set file [tk_getOpenFile]
	set newfile $file
}
entry .f2.in -textvariable file -width 44
pack .f2.get .f2.in -side left -fill x -padx 3

frame .f4
pack .f4 -side top -fill x -padx 3 -padx 4
button .f4.get -text "Save File:" -width 12 -command {
	set newfile [tk_getOpenFile]
}
entry .f4.out -textvariable newfile -width 44
pack .f4.get .f4.out -side left -fill x -padx 3

frame .f3
pack .f3 -side top -fill x -padx 3 -pady 4
label  .f3.tra -text "Translate:" -width 14

button .f3.fixwin -text "to Windows" -width 12 -command {
	set infile [open $file r]
	set outfile [open fixtemp.temp w]
	fconfigure $outfile -translation crlf
	puts -nonewline $outfile [read $infile]
	close $infile
	close $outfile
	file rename -force fixtemp.temp $newfile
}

button .f3.fixunix -text "to Unix" -width 12 -command {
	set infile [open $file r]
	set outfile [open fixtemp.temp w]
	fconfigure $outfile -translation lf
	puts -nonewline $outfile [read $infile]
	close $infile
	close $outfile
	file rename -force fixtemp.temp $newfile
}

button .f3.fixmac -text "to Mac" -width 12 -command {
	set infile [open $file r]
	set outfile [open fixtemp.temp w]
	fconfigure $outfile -translation cr
	puts -nonewline $outfile [read $infile]
	close $infile
	close $outfile
	file rename -force fixtemp.temp $newfile
}

pack .f3.tra .f3.fixwin .f3.fixunix .f3.fixmac -side left -padx 3