12-26-2008 09:51 PM
N00001D2312T140402N00002D2312T140403N00003D2312T140403N00004D2312T140404N00005D2312T140404N00006D2312T140404N00007D2312T140405N00008D2312T140405N00009D2312T140405
i have this data i want to split it to 72 character and put a end line
some thing like this below:
N00001D2312T140402N00002D2312T140403N00003D2312T140403N00004D2312T140404
N00005D2312T140404N00006D2312T140404N00007D2312T140405N00008D2312T140405
N00009D2312T140405
currently i just have few data if in future i will have much... plz help. thk u
12-26-2008 10:28 PM
a. Create a while loop.
b. Find the string length and use that number for number of iteration that you need.
c.Use String Subset to break the string into parts,
d. use carriage return or line feed constant in the string palette and concatenate with the string subset using concatenate string vi again in the string palette.
12-26-2008 11:17 PM
12-26-2008 11:29 PM - edited 12-26-2008 11:34 PM
Hi Jeyanthi,
There is a number of way to do that. I have attached one possible way. I hope it helps.
Aman
12-27-2008 09:01 AM - edited 12-27-2008 09:02 AM
aman_bajra, there is a problem with your proposed solution : the resulting string contains only the last chunk of data, with a probably unwanted terminal CR.
You need to test the length of the splited string before adding or not a CR, and concatenate the string using a shift register...
05-05-2011 06:53 AM
Hi
i have one similar problem. i explain : i have for example some string like that
"<pays> Finland </pays> <ville> Tampere </ville> <temperature> 17~C </temperature> <ensoleillement> Nuageux </ensoleillement>" (xml code).
And i want my programme just give me:
" Finland Tampere 17~C Nuageux ".
In the qim to published it.
I used some cluster for my string some for loops but i haven´t succeeded.
An other problem is i don´t know all the time when i have to split, the lengh of the string is variable so i can´t do as you do. I mean to split all the 72 char for example. I tried many thing but i really have great difficulty to do that. I have really not anymore ideas how to do that.
So please help me i am becoming crazy because of that one.
PLEEEEEEEEEEEEEEEEEEASE 🙂
thank you so much
BaccAdr
Sorry for my english i am a french student on a finnish keyboard
05-05-2011 07:16 AM
Hi Bacc Adr,
Check the attached VI. I think it will solve your problem..
Regards,
Nitzz
(Kudos are always Welcome;))
05-05-2011 08:44 AM - edited 05-05-2011 08:50 AM
Hi Nittz,
Your code could be simplified using Regular Expressions as shown below: (bottom code)
The solution is more flexible as it does not hard code how many tags to remove.
05-05-2011 06:43 PM
I found out I had a Rube Goldberg of my own!!!
Thanks to Darin for the improvement. Amazing what can be done with a boolean 😉
LOL!
05-06-2011 01:06 AM
Hi both of you,
This is almost perfect and you are (almost) both god for me, I will analyze precisely that soon ( but Ray R i did not have time to use you because at home i have only LV 7.1). But small problem wich stay with the first big, it´s i said
"<pays> Finland </pays> <ville> Tampere </ville> <temperature> 17~C </temperature> <ensoleillement>Nuageux </ensoleillement>"
just as example but it could be totally random, so the data could be longer as
"<pays> Finland </pays> <ville> Tampere </ville> <temperature> 17~C </temperature> <ensoleillement> Nuageux </ensoleillement> <date>5 mai </date> <time> 3:00 pm </time>"
or shorter.
But don´t worry I will try to find a solution and if i have a HUGE problem I would come back to you.
I don´t know if you just come to make this one but it´s really impressive. The function you used are well concatenate string & match pattern ?
THAAAAAAAAAAAAAAAAAAAAN YOUUUUUUUUUHOUUUUUUUUU
so much
Best regards
BaccAdr