Login
Login
Register
Questions
Unanswered
Tags
Users
Ask a Question
Ask a Question
How to cast a data type?
0
votes
asked
Feb 9, 2022
in
Grammars
by
jlawhead
(
120
points)
The file format I'm working with (NITF) stores the record count as ASCII to represent a 3-digit number between 000-999. Is there a way to transform that value to the corresponding integer so I can use it to repeat the record structure?
python
scripts
string
structure
Please
log in
or
register
to answer this question.
1 Answer
0
votes
answered
Feb 17, 2023
by
andreas
(
3,500
points)
This is actually a hidden feature: simply create a string element (name without spaces!) for the number, then use its name as Repeat/max count. The string is treated as a decimal number.
Please
log in
or
register
to add a comment.
Welcome to Synalysis Q&A, where you can ask questions and receive answers from other members of the community.
All categories
Grammars
(21)
Hexinator
(8)
Synalyze It!
(21)
Scripting
(12)
Related questions
Referring to a Data Type script from a script element
Displaying masked data as a different type
Is there a way to get nibble arrays to obey endianness?
How to export parsed results to a file
how do i reject a zero length string - or alternatively how do i terminate parsing an element from a script?
Most popular tags
grammar
hexinator
scripts
python
structure
value
endianness
repeat
numberelement
offset-search
automation
floating-point-numbers
variable-length
bit-logic
padding
result
string
object-file
omf-51
font
consists-of
meter-bus
m-bus
cpap
conditional
date
dates
dump
nokia
decode
bug
bin
decrypt
openssl
wav-files
corrupted
audio
csv
lengthunit
structuremapper
headers
signature
pattern
aob
diff
export
hex-editing
installer
elf
masks
magicnumber
derive
mapper
delimited
change
no
getcurrentresults
element
file
length
order
...