Remove Embedded kCr's for Import

Dan Ridinger dlr at futurechalk.com
Wed Feb 24 00:42:27 UTC 2021


Hello Alan,

I usually read in the file line by line and write it back out. Using this snippet of code to remove things I don’t want. You could add kCr as a value to replace.

#
# Launder Column names
#
Calculate L_COLUMN_VALUE as replaceall(L_COLUMN_VALUE,'"','') ## Remove double quote marks
Calculate L_COLUMN_VALUE as replaceall(L_COLUMN_VALUE,'/','') ## Remove / causes code failure on the DO command
Calculate L_COLUMN_VALUE as replaceall(L_COLUMN_VALUE,'-','') ## Remove - causes code failure on the DO command
Calculate L_COLUMN_VALUE as replaceall(L_COLUMN_VALUE,'.','') ## Remove . causes code failure on the DO command
Calculate L_COLUMN_VALUE as trim(L_COLUMN_VALUE) ## Remove leading and trailing spaces



Dan Ridinger
Managing Director




FutureChalk Software Inc.			
20521 92A Avenue						
Langley, BC  V1M 1B7
					
Phone No: 604.723.6837
EMail: dlr at futurechalk.com
www: www.futurechalk.com

> On Feb 23, 2021, at 2:52 PM, Alan Grinberg <omnis at alangrinberg.com> wrote:
> 
> Hello all,
> 
> I suspect a number of other developers have run into this problem. It seems rather generic.
> 
> Using Studio 8.1 on Mac and Windows
> We are importing a csv text file into an Omnis list:
> 
>> Prepare for import from file {Delimited (commas)}
>> Import Data
> 
> If a text field has an embedded kCr, it causes the import to create a new line in the list (i.e., a new record).
> 
> Is there some code that can deal with this?
> Or an algorithm to take the entire file and do a search and replace on these internal kCr's and leave the end of record kCr's alone?
> 
> - Alan
> 
> ----------------------------------------------------
> Alan Grinberg
> AG Systems/ZOO-INK
> San Francisco, CA 
> 
> www.zoo-ink.com <applewebdata://2B18004F-A5D7-4E81-AEE6-E2539DE016A7>
> www.perfectfit.net
> alan at perfectfit.net
> ----------------------------------------------------
> 
> 
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list