How replace the blank space?

Ryu
Member Posts: 26
Hi,
I want replace the blank space by a caracter in an export of data. Because I have a problem when I want read the csv file in Excel. The blanck space is considering like a Return.
Do you have an idea?
Thanks a lot.
I want replace the blank space by a caracter in an export of data. Because I have a problem when I want read the csv file in Excel. The blanck space is considering like a Return.
Do you have an idea?
Thanks a lot.
0
Comments
-
Sorry I did not see the Axapta - A Dynamics answer is no good in here :oops:Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Thank for your answer, but I don't find the repstr function.
If I have understand, this function realize a replacement of character by another? It's true?0 -
For me you have to write the function you need :
You can try to do a "while" instruction with the instruction strfind.
This function return the position of the caracter you are looking for.
Then you can add your string.
other interresting instructions :
strlen : return the Lenght of the string
strLtrim : delete the spaces in the beginning of the string
strRtrim : delete the spaces in the end of the string
substr : return a piece of a string
En français :
Pour moi, tu dois écrire la fonction dont tu as besoin car elle n'existe pas
Tu devrais essayer de faire une boucle en utilisant l'instruction strfind.
Cette instruction te permet de trouver la position du caractère que tu cherche.
Tu peux ensuite remplacé ce caractère par celui de ton choix en faisant des concaténations de morceau de chaine.
autres instructions qui peuvent te servir :
strlen : pour connaitre la taille d'une chaine de caractère.
strLtrim : supprime tous les blanc en début de chaine
strRtrim : supprime tous les blanc en fin de chaine
substr : renvoi un morceau de chaine de caractère
Bon courage0 -
Merci titof pour cette réponse. Je regarde pour créer cette fonction.0
-
Instead of writing your own code and debugging it after that, you might consider checking out the Global methods strReplace
The code of strReplace is as follows:static str strReplace(str _str, str _fromStr, str _toStr) { int charNum; int fromLength = strLen(_fromStr); int toLength = strLen(_toStr); if (_fromStr != _toStr) { charNum = strScan(_str, _fromStr, 1, strLen(_str)); if (fromLength != toLength) { while (charNum) { _str = strDel(_str, charNum, fromLength); _str = strIns(_str, _toStr, charNum); charNum = strScan(_str, _fromStr, charNum + toLength, strLen(_str)); } } else { while (charNum) { _str = strPoke(_str, _toStr, charNum); charNum = strScan(_str, _fromStr, charNum + toLength, strLen(_str)); } } } return _str; }
Vanya Kashperuk,
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888
Inside Dynamics AX 4.0 in Russian - http://www.ozon.ru/context/detail/id/37145820
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions