qwerty3321 Posted December 4, 2018 Report Share Posted December 4, 2018 hello there , I have a normal text file . Is there anyway to create .json file using that txt file from labview? Quote Link to comment
Popular Post drjdpowell Posted December 4, 2018 Popular Post Report Share Posted December 4, 2018 Yes. 3 Quote Link to comment
qwerty3321 Posted December 4, 2018 Author Report Share Posted December 4, 2018 could you give me a small example please? Quote Link to comment
drjdpowell Posted December 4, 2018 Report Share Posted December 4, 2018 3 hours ago, qwerty3321 said: could you give me a small example please? No.Ā You haven't given any information about your "normal" text file. Quote Link to comment
qwerty3321 Posted December 5, 2018 Author Report Share Posted December 5, 2018 14 hours ago, drjdpowell said: No.Ā You haven't given any information about your "normal" text file. just a normal simple text file to json sample.txt Quote Link to comment
smithd Posted December 5, 2018 Report Share Posted December 5, 2018 There does not appear to be anything standard about that 'normal' file. I don't think I've ever seen such a file before. To give you a clear picture of the complexity of what you are asking, and why drjd is quite right....just looking at that example I would assume the following about your file: The entire file is a single json object The first line is the 1 and only key within that object there is a CRLF between the key and its value The rest of the file is the value of the single key The single element is itself an object This object consists of key-value pairs separated by "-" and delimited by CRLF Every value is a string Your file cannot contain strings which contain CRLF Following these rules, your json output would be:Ā {"Details": {"Name":"abc", "Organization": "anonymous", "Location": "xyz"}} If that is what you want, then my only answer is that you will have to procedurally parse the entire file from a string and construct the json object manually. If that is not what you want, then you should figure out the rules for your "normal simple" file. Once you figure out the rules, you will still have to manually write the code because that isn't a standard computer-parse-able format that I am aware of. If there are no rules, then you may need to consider a different strategy for whatever it is you are actually trying to accomplish. For example if you are making your files into json to make them easier for a computer to parse, then you'd be better of just shoving all these "normal simple" text files into elastic search or splunk and never look at them again. Quote Link to comment
qwerty3321 Posted December 5, 2018 Author Report Share Posted December 5, 2018 I'm sorry about that. so here i have attached a file in json format text file . can i create .json using this ?and how sample1.txt Quote Link to comment
qwerty3321 Posted December 5, 2018 Author Report Share Posted December 5, 2018 16 hours ago, Gribo said: where can i find that json palette which you have used Quote Link to comment
qwerty3321 Posted December 5, 2018 Author Report Share Posted December 5, 2018 I got the output in json string after parsing . how do i create this in .json format as output Quote Link to comment
Gribo Posted December 5, 2018 Report Share Posted December 5, 2018 In your diagram, probe #2 is your object. You need to convert it to your specific cluster. The text you are showing is JSON format, what else do you want? .JSON files are text files. The JSON Library I used isĀ Labview JSON Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.