Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,


Need help in Visual basic 6.0 to convert text containing data of 35 fields into text tab delimited with removing special characters as like 11111, IIIII, I I I, III. All Data should be preserved. Pls help



895436108 11111 Adelina . Lano . schnaible 11111 Rita@crossstltchunlimited.com III I 134 E. Main Street, Paducah III I I Kentucky I I II 40511-8431 (727) 853—6994 1111 Versailles 11111 QOTRR-XXN20213xXN20222 III I I 000-42-1309 1 (739) 108-3982 120.99XVWx liii EWQTH-9O9O7S83QXVFdCV III 98.828 I I II 563914 1111 116.69 lbs I I 681RX N993 11111 169.81 cms 11111 100RX3S 11111 681.993 III SAqWT-687634970ETY3XR liii MW Hsoutheastautobody.com 11111 52411 III $11.12 I I O2YTGDV-N73722759X-EUyK I II $167.69 III I I 55392PB00 I I II 7.61 I ##YTR## - 7.69 III $178.81 I I 300 w 2nd Ave , Lenexa I I I AB - 11111 R040/774 11111 42211-9143 I Fifteen-Years


895436108
Adelina . Lano . schnaible
Rita@crossstltchunlimited.com
134 E. Main Street, Paducah
Kentucky
40511-8431
(727) 853—6994
Versailles
QOTRR-XXN20213xXN20222
000-42-1309
(739) 108-3982
120.99XVWx
EWQTH-9O9O7S83QXVFdCV
98.828
563914
116.69 lbs
681RX N993
169.81 cms
100RX3S
681.993
SAqWT-687634970ETY3XR
MW Hsoutheastautobody.com
52411
$11.12
O2YTGDV-N73722759X-EUyK
$167.69
55392PB00
7.61
##YTR## - 7.69
$178.81
300 w 2nd Ave , Lenexa
AB -
R040/774
42211-9143
Fifteen-Years

Regards,
Posted

You can use the Visual Basic 6 String Functions | Visual Basic 6 (VB6)[^] to modify the content, or split it into separate strings.
 
Share this answer
 
Those are not 'special characters', they are 'special patterns' (or 'special substrings').
Hence the Instr function is your friend. See "Visual Basic 6 String Functions | Visual Basic 6 (VB6)"[^].
 
Share this answer
 
Comments
Member 12280617 27-Jan-16 8:36am    
Hi CPallini,

Thanks for the help provided.

It worked somehow...but not completely. Means solution worked to break the string into array of words separated by special patterns as well as spaces, but it creates more fields data. As data pattern is different for different fields its not working out properly.
( e.g 2nd record is - Adelina . Lano . schnaible ( name . middlename . last name format )
whereas 7th field is - (727) 853—6994 -> (code) number-number) format )

while some fields contains $ or ##YTR## pattern or email id pattern.

Kindly help with some sample code if possible.

Regards,
Richard MacCutchan 27-Jan-16 8:59am    
There is no sample code. The problem is specific to the data you are working with, so you need to write the code to handle that data. Your program needs to have a method of recognising the different patterns and handling them according to your requirements.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900