-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Utility software to prepare files for sfdd #17
This script prepares the txt files generated by sfipick in a format readable by sfdd that convets them to RSF
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# | ||
# ascFormat.sh (Shell Script) | ||
# | ||
# Purpose: Convert txt files generate by sfipick (iterative picking) | ||
# to asc format accepted by sfdd to be converted to RSF. | ||
# | ||
# Site: https://dirack.github.io | ||
# | ||
# Version 1.0 | ||
# | ||
# Programer: Rodolfo A C Neves (Dirack) 06/03/2021 | ||
# | ||
# Email: rodolfo_profissional@hotmail.com | ||
# | ||
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>. | ||
|
||
[ -z "$1" -o "$1" == "-h" -o "$1" == "--help" ] && { | ||
echo "Usage: <pick.txt $0 outfilename column > outfilename.asc" | ||
echo "'pick.txt' is a file generated by sfipick" | ||
echo "'outfilename' is the name of the output file" | ||
echo "'column' is the number of the column selected from 'pick.txt'" | ||
exit 0 | ||
} | ||
|
||
INPUT=$(cat "-" | tr '\t' ' ' | cut -d' ' -f"$2") | ||
NUMBER_OF_POINTS=$(echo "$INPUT" | wc -l) | ||
FORMATED_INPUT=$(echo "$INPUT" | tr '\n' ' ') | ||
FILE="$1" | ||
|
||
echo "${FORMATED_INPUT}n1=$NUMBER_OF_POINTS d1=1 o1=0 data_format=ascii_float in=$1" | ||
|