Skip to content

Commit c882bfb

Browse files
committed
Adding dialect as an input option
1 parent f72f350 commit c882bfb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spicelib/scripts/raw_convert.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def main():
5959
help='Value separator for CSV output. Default: "\\t" <TAB>\n'
6060
'Example: -d ";"'
6161
)
62+
parser.add_option('-D', '--dialect', dest='dialect', default=None,
63+
help="Dialect to pass to RawRead (e.g., 'ltspice' , 'qspice', 'ngspice' ,'xyce')")
64+
6265

6366
(options, args) = parser.parse_args()
6467

@@ -76,7 +79,7 @@ def main():
7679

7780
# Read the raw file
7881
if traces != '*':
79-
raw_data = RawRead(rawfile, verbose=False)
82+
raw_data = RawRead(rawfile, verbose=False, dialect=options.dialect)
8083
raw_traces = raw_data.get_trace_names()
8184
found_traces = []
8285
for trace in traces:
@@ -105,7 +108,7 @@ def main():
105108
print("Reading traces: ", found_traces)
106109

107110
else:
108-
raw_data = RawRead(rawfile, traces, verbose=options.verbose)
111+
raw_data = RawRead(rawfile, traces, dialect=options.dialect, verbose=options.verbose)
109112

110113
# Output the file
111114
if options.output is None:

0 commit comments

Comments
 (0)