12-10-2012 12:23 AM
Hi guys
I have a .txt file. In that file the data are stored like "$341ACF12341ACF12341ACF12341ACF12341" now I want to read the next 128 bytes after that "$" character ??
How to execute that??
Thanks in advance
Niladri
Solved! Go to Solution.
12-10-2012 12:36 AM - edited 12-10-2012 12:38 AM
"Read Text File". Then look at the "Search/Split String" and "String Subset" VIs in the String palette to slice and dice it.
12-10-2012 12:45 AM - edited 12-10-2012 12:45 AM
hi Newbee_3,
Hope this attached image will help you. If not than let me know.
Thanks
Ranjeet
12-10-2012 01:07 AM
Actually my file contains many $ character as the file gets updated so does the no of "$" character and their is no way to tell how many "$" is their only that each $ character is separated by 127 bytes. That is my main requirement
Sorry for giving wrong information at the first place
Thanks in advance
Niladri
12-10-2012 01:15 AM
Then use an offset to read the latest one... Use kind of FOR loop.
12-10-2012 01:20 AM
Can you please elaborate it?
Thanks in advance
Niladri
12-10-2012 01:27 AM
what i mean to say that as soon as you read the data & appends on txt file
1. Convert the data into string.
2. Inside for loop read the substring with number of char as 120 & offset as i(Current itearation of FOR loop) * 120.
3. Read the 120 char or bytes & play with it..
See i haven't saw your code so i can give you only suggestion, Implementing & placement of components depends on your application.
If you are not still satisfied than let me know, i will elobrate again with one illustrative image
Thanks,
12-10-2012 01:36 AM
Here, assuming you are reading the entire file rather than line by line:
12-10-2012 02:08 AM
You can read the text file to read the data as a string and use $ as a delimiter in Convert spreadsheet string to array.
12-10-2012 09:04 AM
Or, use Read From Spreadsheet File.vi with $ as the delimiter.
Lynn