Normal Topic need help with @instr command (Read 1638 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
need help with @instr command
Jun 16th, 2004 at 8:38pm
Print Post Print Post  
I have some subrecords with a text field that shows the following:

LE Name = Size:
2' 6" x 4' 6"   (pasted into this message from the actual sub-record)

I used the following command to seperate the width from the length.

vsize1 = split(size, "x")
vsize2 = size

this has been working great, but only on records that I added manually. It does not work on records that I imported from a .txt file. It seems that sesame cant find the 'x' to split, so it 'splits' the whole line and vsize2 gets a '0'.

I tried split(size, @chr(120))  as well as split(size, @chr(88)) and it doesnt help.

If I enter the LE and type an x over the existing x it works fine.??? Also, doing a search for '..x..' finds ALL the records.

What gives?

Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: need help with @instr command
Reply #1 - Jun 16th, 2004 at 8:48pm
Print Post Print Post  
Your x may not actually be an x. Where did the text file come from?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need help with @instr command
Reply #2 - Jun 16th, 2004 at 9:07pm
Print Post Print Post  
Your right,

I did a @replace(size, "x", @chr(88 )) and it seemed to replace them all to "X",  but still sesame can not detect the @chr(88 ) or @chr(120) or "x".

The data came from a q&a export file, saved as .csv then imported via programming into sesame.

Thanks,
Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need help with @instr command
Reply #3 - Jun 16th, 2004 at 9:15pm
Print Post Print Post  
Ps. There is a slim chance that I opened the csv file in Excel (can I use that name around here?  Wink ) and made some slight changes, then re-saved as a csv file before importing in sesame.

Not 100% sure.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
OpRe: need help with @instr command
Reply #4 - Jun 16th, 2004 at 9:19pm
Print Post Print Post  
OOPS.

Looks like the programming to replace 'x' with @chr(88 ) DID work after all.

I can now split(vsize, @chr(88 )) and its all ok.

Any idea how the 'x' stopped being an 'x' during the import?

Thanks,
Steve

Edit: It's odd how I can search and replace for this 'faux' X, but I can not use programming to Split the X. Does the Split command have some 'issues'? Is the split command case sensitive?
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: need help with @instr command
Reply #5 - Jun 16th, 2004 at 9:52pm
Print Post Print Post  
It may never have been an x. It might have been ASCII 215, or something like that. I'd have to see the csv file to tell.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need help with @instr command
Reply #6 - Jun 16th, 2004 at 9:59pm
Print Post Print Post  
I plan to do a lot of importing 'splitting' and it appears the Split command is 'sensitive' to the actual character its looking for.

Shouldnt Lantica make Split more 'lenient'?

Can you direct me as to how I can learn exactly what ascii character I'm looking at when I see 'x' in a .CSV or .TXT file?

Thanks,
Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need help with @instr command
Reply #7 - Jun 16th, 2004 at 10:11pm
Print Post Print Post  
Looking at page 248 in the programming manual, it appears I can have sesame tell me what ascii character i'm looking at by using:

@asc(x)

Would this be the answer when 'split' command is not finding what appears to be in the LE?

Thanks,
Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: need help with @instr command
Reply #8 - Jun 16th, 2004 at 10:46pm
Print Post Print Post  
Quote:
I plan to do a lot of importing 'splitting' and it appears the Split command is 'sensitive' to the actual character its looking for.

Shouldnt Lantica make Split more 'lenient'?


No! When talking about a delimiter, you should be able to be very specific, to avoid splitting in unexpected places. For your purposes, Split can take multiple delimiters. You can get both cases by using:
Split(vString, "xX")

Quote:
Can you direct me as to how I can learn exactly what ascii character I'm looking at when I see 'x' in a .CSV or .TXT file?


Use @Asc().
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need help with @instr command
Reply #9 - Jun 16th, 2004 at 10:52pm
Print Post Print Post  
Great tips! I'll be getting to know @Asc really well.  Smiley

Thanks!

Steve
  
Back to top
IP Logged