Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
2591d585
Commit
2591d585
authored
Jan 03, 2017
by
Michael Ott
Browse files
Add command line parameter -i to specify starting topic number (default is 0)
parent
2956cfa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/dcdbcsvimport/dcdbcsvimport.cpp
View file @
2591d585
...
...
@@ -73,11 +73,16 @@ int main(int argc, char** argv)
host
=
"localhost"
;
}
while
((
ret
=
getopt
(
argc
,
argv
,
"+h:"
))
!=-
1
)
{
int
indexOffset
=
0
;
while
((
ret
=
getopt
(
argc
,
argv
,
"+h:i:"
))
!=-
1
)
{
switch
(
ret
)
{
case
'h'
:
host
=
optarg
;
break
;
case
'i'
:
indexOffset
=
atoi
(
optarg
);
std
::
cout
<<
"i: "
<<
optarg
<<
std
::
endl
;
break
;
default:
usage
(
argc
,
argv
);
exit
(
EXIT_FAILURE
);
...
...
@@ -104,8 +109,8 @@ int main(int argc, char** argv)
std
::
string
s
;
std
::
vector
<
std
::
string
>
vec
;
std
::
vector
<
sensor_t
>
sensors
;
std
::
string
csvFilename
=
argv
[
1
];
std
::
string
prefix
=
argv
[
2
];
std
::
string
csvFilename
=
argv
[
optind
];
std
::
string
prefix
=
argv
[
optind
+
1
];
uint64_t
lineno
=
0
;
/* Read header line from CSV to obtain sensor names and topics */
...
...
@@ -116,7 +121,7 @@ int main(int argc, char** argv)
std
::
getline
(
fs
,
s
);
lineno
++
;
boost
::
tokenizer
<
boost
::
escaped_list_separator
<
char
>
>
tk
(
s
,
boost
::
escaped_list_separator
<
char
>
(
'\\'
,
','
,
'\"'
));
int
topics
=
0
;
int
topics
=
indexOffset
;
for
(
boost
::
tokenizer
<
boost
::
escaped_list_separator
<
char
>
>::
iterator
i
=
tk
.
begin
();
i
!=
tk
.
end
();
++
i
)
{
if
(
i
==
tk
.
begin
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment