aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-05-31 15:38:44 -0700
committerBryan Newbold <bnewbold@archive.org>2020-05-31 15:38:44 -0700
commitfbdeaed50be59a5b9574674a51bede021458c45c (patch)
tree372e8c28447b68012f47e1a845f377810fd05fc7 /src
parent1a4906b89123f015dfb1337e384ebed696d09f5c (diff)
downloadaft-fbdeaed50be59a5b9574674a51bede021458c45c.tar.gz
aft-fbdeaed50be59a5b9574674a51bede021458c45c.zip
implement group delimiter character
Diffstat (limited to 'src')
-rw-r--r--src/bin/aft-demo.rs14
-rw-r--r--src/bin/aft.rs2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/aft-demo.rs b/src/bin/aft-demo.rs
index 9a680c1..ead5089 100644
--- a/src/bin/aft-demo.rs
+++ b/src/bin/aft-demo.rs
@@ -18,18 +18,18 @@ fn main() {
print!("\x01");
// colum names
- println!("{}", ["Sepal length", "Speal width", "Petal length", "Petal width", "Species"].join("\x1E"));
+ println!("{}\x1D", ["Sepal length", "Speal width", "Petal length", "Petal width", "Species"].join("\x1E"));
// colum types
- println!("{}", ["float", "float", "float", "float", "str"].join("\x1E"));
+ println!("{}\x1D", ["float", "float", "float", "float", "str"].join("\x1E"));
// end header / start table
print!("\x02");
// print rows
- println!("{}", ["5.1", "3.5", "1.4", "0.2", "I. setosa"].join("\x1E"));
- println!("{}", ["4.9", "3.0", "1.4", "0.2", "I. setosa"].join("\x1E"));
- println!("{}", ["4.7", "3.2", "1.3", "0.2", "I. setosa"].join("\x1E"));
- println!("{}", ["4.6", "3.1", "1.5", "0.2", "I. setosa"].join("\x1E"));
- println!("{}", ["5.0", "3.6", "1.4", "0.2", "I. setosa"].join("\x1E"));
+ println!("{}\x1D", ["5.1", "3.5", "1.4", "0.2", "I. setosa"].join("\x1E"));
+ println!("{}\x1D", ["4.9", "3.0", "1.4", "0.2", "I. setosa"].join("\x1E"));
+ println!("{}\x1D", ["4.7", "3.2", "1.3", "0.2", "I. setosa"].join("\x1E"));
+ println!("{}\x1D", ["4.6", "3.1", "1.5", "0.2", "I. setosa"].join("\x1E"));
+ println!("{}\x1D", ["5.0", "3.6", "1.4", "0.2", "I. setosa"].join("\x1E"));
}
diff --git a/src/bin/aft.rs b/src/bin/aft.rs
index 0ada921..25aa0f7 100644
--- a/src/bin/aft.rs
+++ b/src/bin/aft.rs
@@ -97,7 +97,7 @@ fn main() -> Result<(), Box<dyn Error>> {
writeln!(tw, "{}", header.col_names.join("\t").bold())?;
for line in stdin.lines() {
let line = line?;
- writeln!(tw, "{}", line.replace("\x1E", "\t"))?;
+ writeln!(tw, "{}", line.replace("\x1E", "\t").replace("\x1D", ""))?;
}
tw.flush()?;