Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FILE2DVCmd = &cobra.Command{ Use: "file2dv", Short: "Extract and Transform from multiple files to CSV, for Geneos Toolkit input", Long: ``, SilenceUsage: true, CompletionOptions: cobra.CompletionOptions{ DisableDefaultCmd: true, }, Version: cordial.VERSION, DisableAutoGenTag: true, DisableSuggestions: true, DisableFlagsInUseLine: true, RunE: func(cmd *cobra.Command, args []string) (err error) { d := config.Join("dataviews", strconv.Itoa(d)) if !cf.IsSet(d) { return errors.New("no dataviews found in configuration") } dv := cf.Sub(d) dataview, err := processFiles(dv) if err != nil { return } for _, r := range dataview.Table { var row []string for _, c := range r { row = append(row, strings.ReplaceAll(c, ",", "\\,")) } fmt.Println(strings.Join(row, ",")) } if dataview.Name != "" { fmt.Printf("<!>dataview,%s\n", dataview.Name) } for _, h := range dataview.Headlines { fmt.Printf("<!>%s,%s\n", h.Name, strings.ReplaceAll(h.Value, ",", "\\,")) } return }, }
FILE2DVCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.