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
$ cat read3.mjs | |
import csv from "fast-csv"; | |
let expected = [ | |
['Col1','Col2','Col3'], | |
['1.1','1.2','1.3'], | |
['2.1','2.2','2.3'], | |
]; | |
let input = `Col1,Col2,Col3 | |
1.1,1.2,1.3 |
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
package main | |
/* | |
To correctly produced in the output PDF the input string "Молоко и творог" | |
which is Russian, use codepage 1251; must also do the following: | |
- use the unicode translator method in gofpdf | |
- in the specifed font directory must be the following: | |
1. cp1251.map: the codepage mapping | |
2. helvetica_1251.z: font file (from the gofpdf project) | |
3. helvetica_1251.json: font descriptor file |
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
$ go run textToList.go -help | |
Help Message | |
Usage: textToList [options] | |
Note: font and line height are 'points', 1/72 inch | |
This example takes a text file of paragraphs and | |
demonstrates how to create a numbered list in PDF format | |
Blank lines are skipped! | |
-compressed | |
Don't add blank line between items |
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
$ cat test1.xml | |
<Person type="alien" thumbs="yes">here is some character data<FullName>Grace R. Emlin</FullName><!-- this is not a comment... just kidding --><Company>Example Inc.<!-- this company excels --></Company></Person> | |
$ | |
$ go run identityXform.go -i test1.xml -indent | |
<Person type="alien" thumbs="yes">here is some character data | |
<!-- this is not a comment... just kidding --> | |
<FullName>Grace R. Emlin</FullName> | |
<Company>Example Inc. | |
<!-- this company excels --></Company> | |
</Person> |
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
$ cat identityxform.go | |
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"os" | |
"strings" | |
) |