LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing .txt to .csv

Hi everyone

I am new to Labview and faced with a challenge. I have a txt data whihc is in a single line format and I am looking at converting it into csv format for easy manipulation in python.

Attached is a screenshot of how the data looks like.data.png

0 Kudos
Message 1 of 6
(279 Views)

Are you asking how to change the file suffix from a TXT file to a CSV? I'd think it's as simple as that.

 

Load your VI and show us what you've tried so far...

0 Kudos
Message 2 of 6
(270 Views)

ikeampem_0-1725392349890.png

Hi Erick   This is the bit I have tried so far. That's just reading the txt file. When i load it in Jupyter notebook, it comes as just a single line which causes the software to crash because it has over 32 million characters. I want to introduce a delimeter to separate the number which will make it easier for me to manipute with python

 

0 Kudos
Message 3 of 6
(253 Views)

Two things that immediately jump out at me.

 

  • You did a screen capture and did not load your VI. Get used to uploading your VI when you ask questions here. Save it as a previous version (2018 I believe it pretty safe). Go to File - Save for Previous Version & choose 18.0. It'll save you (and us) headaches. Also, upload your data too. That way, other users have an idea of what kind of data you're dealing with (which looks like double precision data) and can offer suggestions.
  • Make sure you connect your error wires. They will tell you a lot if an error appears and many can be googled if it's generic and what you are trying to do.

 

As for your data delimiter, it looks like a space or possibly a tab between values. If you download Notepad++, that is an excellent program when looking for delimiters like spaces, commas, carriage returns, line feeds, etc. It can do much, much more than that. I use it quite a bit.

 

See what you can dig up and come back to us.

Message 4 of 6
(234 Views)

Try using a function READ DELIMITED Spreadhseet. 

Use the character delimiter on the input DELIMITER it will return a 2d array with all the lines of data, then use a function index array to select wich of the lines you want to pass to your python code. 

 

ROtake_0-1725393567419.png

 

RKO
Message 5 of 6
(231 Views)

Thanks ROtake

I will give it a shot

0 Kudos
Message 6 of 6
(222 Views)