LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question About A Specific String Conversion

Solved!
Go to solution

Hello Reader,

 

I am converting data from one system to another and that needs conversion of string read from a file. The raw file is in hex format with some spaces. This hex will be converted to a normal readable string.
EDIT

I am getting the desired result but was wondering if there is a better/ direct way to get the same result.

 

String Conversion.png

Note: String constant is showing a section of entire text read, "desired result" is correct.

Thanking you,
X

0 Kudos
Message 1 of 5
(842 Views)

Could you please provide an example of input and output?

 

Is your input string in binary display format?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 5
(830 Views)

Hi Santosh,

 

Previously attached snippet has both input (string constant) and output (Desired Result). No, input string is displayed in normal format.

EDIT

 

File is in .txt format and below is how I am reading it:

XM43_1-1692285099807.png

 

A different section copied from the text file (Just to show how it looks in a notepad) :


00 00 00 51 02 f0 00 42 15 d0 2f 72 c1 08 00 de
02 f0 00 42 15 d0 2f 8e 8b bc 0b d2 02 f0 00 42
15 d0 2f aa b7 72 17 60 02 f0 00 42 15 d0 2f c6
8a 91 32 78 02 f0 00 42 15 d0 2f e2 44 f9 bf 96
02 f0 00 42 15 d0 30 8a 0c 31 7c 40 02 f0 00 42


Please do not use this for conversion as result will not make much sense.

XM43_2-1692285393244.png

 

0 Kudos
Message 3 of 5
(821 Views)
Solution
Accepted by topic author XM43

May be something like that will be shorter:

Screenshot 2023-08-17 17.29.26.png

Using Spreadsheet String to Array and Space as delimeter. You have to remove double spaces first to avoid zeroes.

Message 4 of 5
(813 Views)

HI Andrey_Dmitriev,

 

Yes, this is better! Thank you for the suggestion.

 

I will be stunned if it can be any shorter. 😄

EDIT: This actually corrected one mistake that I was making

0 Kudos
Message 5 of 5
(807 Views)