Extracting all characters of a postcode before the space
I am trying to extract the first characters from a postcode into a separate field that can then be used as a parameter. If i search on postcodes starting with (for example) M1, this is bring out not only M1 but also M11, M12, etc.
I have found a While Constructs formula example in my training book that extracts the Surname from a field containing the FirstName and Surname. I have recreated this and applied to my postcode field but it is bring out the characters AFTER the space in the postcode and not the characters BEFORE.
Does anybody know how to reverse the following so that it extracts the characters BEFORE the space?
stringVar PCode := {ADDRESS.POSTCODE};
numberVar i:=1;
numberVar Strlen := length (PCode);
numberVar Result:= -1;
while i <= Strlen and Result= -1 do
stringVar Position:= Mid (PCode,i,1);
if Position = " " then
Result:= i;
i:= i + 1;
stringVar PostSearch := mid (PCode, Result+1, (Strlen-Result));
PostSearch
Hello Tracy,
I am not sure how to help you on this however I have found an interesting code from one of the forums, see if that makes your life any better.
Here's the code to extract the zip. what i did is checked for a number in the string, once i found it i checked
for next 4 character if they are number (as zipcode is 5 digits). if all 5 character are number then i m assiging
it to a variable and coming out of loop otherwise i m going for next charachter.
creat two formulas
1st formula name is "zipcode" which has following code
shared numbervar strlen := length({table.fieldname});
shared stringvar zipcode := "";
shared numbervar i := 0;
shared numbervar a := 0;
shared numbervar b := 0;
shared numbervar c := 0;
shared numbervar z := 0;
for i := 1 to strlen do
if mid({table.fieldname},i,1) in ["0","1","2","3","4","5","6","7","8","9"] then
a := i;
b := i;
c := i + 4;
z := 0;
zipcode := "";
for a := b to c do
( if mid({table.fieldname},a,1) in ["0","1","2","3","4","5","6","7","8","9"] then
(z := z + 1;
zipcode := zipcode &mid({table.fieldname},a,1);
if z = 5 then
i := i+strlen+1;
zipcode)
else
zipcode;
2. the 2nd formula is "zip" which has folllowing code
shared stringvar zipcode;
now keep both the formula in the report and supress zipcode.
You will get the zipcode
As I said this is not mine, I took it from somewhere else however the way he did it, makes more sense.
Let us know if this works.
Regards
Jehanzeb
Similar Messages
-
I downloaded the new mavericks operating system on my macbook pro and I can't find out how much space I have left. Before the installation of mavericks, storage space left was displayed at the bottom of the Finder window.
In the Finder, under the View menu there is an option to Show Status Bar. Select that and you will see the info on the bottom of folders again.
-
After the update, all my previous texts are gone and my icon shows I have new texts. How do I clear my icon so it shows no new texts?
Did you try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again? You will not lose data by resetting, but it can cure some glitches.
-
Here we go again - all pear-shaped and customer on the warpath...
This customer of mine seems destined to suffer one disaster after another. This time, they ran out of space on the boot drive sometime last Friday night - this time for fairly reasonable reasons (although named.log was about 15Gb in size for some reason). Mail had fallen over due to lack of space. I got in and found some space (55Gb no less), rebooted the server and expected all to be well. However, mail services will not work now.
The first thing I noticed was this:
relay=none, delay=28030, status=deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]: Connection refused)
I thrashed about a bit in my usual cack-handed way and eventually ran mailbfr -o to see if there was an ownership problem involved.
The next thing I noticed was that after two or three attempted receipts of incoming mail, this happens:
postfix/master[649]: terminating on signal 15
The system log shows:
deliver[666]: connect(/var/imap/socket/lmtp) failed: No such file or directory
Now, the thing that's pressing on my mind is that the configuration worked nicely until the server ran out of space. Some config file somewhere must be corrupt but I'm unable to see it. I've stared at main.cf and master.cf until my eyes hurt and nothing seems wrong. There's no 'lmtp' in the socket directory but I can't see how to put one there - that's postfix's job, isn't it?
Naturally any attempt to connect from a mail client while the system is up is refused (squirrelmail reports an error 61 - Mail just says the connection is refused).
There have been no entries to the server admin mailaccess log or imap log since before the space ran out.
More in hope than expectation, I also ran mailbfr -f but I don't really think the problem lies with the database. Postfix has its knickers in a twist and I can't get a handle on what's gone wrong.
By the way - it's an Xserve which was running 10.4.9 at the time but the customer updated it to 10.4.10 this morning thinking this might help. All other services, e.g. DHCP, NAT, firewall, afp, print, web, windows, are working fine.
Tell me what to look for someone?
JustinThanks for responding. It's really reassuring to know you're out there. Quick look at imapd.conf and cyrus.conf and they look "normal" - at least the same as the equivalents on a known working server. Here they are:
cyrus.conf:
standard standalone server implementation
START {
# do not delete this entry!
recover cmd="ctl_cyrusdb -r"
# this is only necessary if using idled for IMAP IDLE
# idled cmd="idled"
# UNIX sockets start with a slash and are put into /var/imap/socket
SERVICES {
# add or remove based on preferences
imap cmd="imapd" listen="imap" prefork=0
# imaps cmd="imapd -s" listen="imaps" prefork=0
# pop3 cmd="pop3d" listen="pop3" prefork=0
# pop3s cmd="pop3d -s" listen="pop3s" prefork=0
sieve cmd="timsieved" listen="sieve" prefork=0
# at least one LMTP is required for delivery
# lmtp cmd="lmtpd" listen="lmtp" prefork=0
lmtpunix cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0
# this is only necessary if using notifications
# notify cmd="notifyd" listen="/var/imap/socket/notify" proto="udp" prefork=1
EVENTS {
# this is required
checkpoint cmd="ctl_cyrusdb -c" period=30
# this is only necessary if using duplicate delivery suppression
delprune cmd="ctl_deliver -E 3" at=0400
# this is only necessary if caching TLS sessions
tlsprune cmd="tls_prune" at=0400
LIMITS {
imaplimit value=400
imapd.conf:
admins: cyrus admin
configdirectory: /var/imap
partition-default: /Volumes/Archive/m+m
unixhierarchysep: yes
altnamespace: yes
servername: mail.mandm.uk.com
sendmail: /usr/sbin/sendmail
logrollingdays: 7
logrolling_daysenabled: true
popauthgssapi: yes
imapauth_crammd5: yes
enable_pop: no
popauthclear: no
quotawarn_frequencydays: 0
# lmtpluser_relayenabled: true
mboxlist_db: skiplist
seenstate_db: skiplist
tlscertfile: /etc/certificates/Default.crt
tlskeyfile: /etc/Certificates/Default.key
imapauthgssapi: yes
imapauthclear: no
I'm curious about the remarked out line above (it doesn't appear at all in the other server's file) but other than that...
I'm going to look into this further and try to understand what makes amavisd and cyrus go.
Thanks
Justin -
Can we receive goods before the delivery date
Hi all
Can we receive goods before the delivery date i.e.
PO is created on 10/04/2008 and in the PO delivery date is given as 14/04/2008.
But if the vendor sends me material on 12/04/2008 system allows me to post the material.
Is there any settings to restrict GR before the delivery date.
With Rgds
VinodThanks for your information
But I dont have enough space to store the material if he delivers before the delivery date.
In this circumstences how can i prevent the system to post the GR.
With Rgds
Vinod -
Material PO texts not captured completely(all characters) in report
Hi Experts,
Please let me know How to capture all characters of a Material PO Text as maintained in Material master in a standalone report.
Have used STXh table to poppulate the characters based on material numbers but it seems all characters are not captured in the report it is truncating some characters from the PO text entry.
Thanks,
AKSHI,
check with your ABAp consultant
How max character you have upload in material master and how max charterer you are reading in your report
that may be reason
Regards
Kailas Ugale -
Regular Expression - Extract words before the PLUS Sign ?
Dear All,
I had many words with having a symbol plus. I need to extract the words before the plus sign.
I can able to do this by using String.indexOf or String.contains. But i like to know is there is any way to do this using Regular Expression.
sample string
Kathire+san Output Kathire
World+islike Output World
Thanks,
J.KathirHere's one way.
import java.util.regex.Pattern;
String input = "abc+def";
Pattern pat = pat.compile("\\+");
String beforePlus = pat.split(input)[0];
Sun's Regular Expression Tutorial for Java
Regular-Expressions.info -
When my music ois playing whether on computer or on iphone, every tune quits before the end, losing as much as a minute sometimes. i know the full song is there because i see the timer moving towards the end but jumps to the next song before it gets anywhere near the end.
All my downloads onto iphone have now got the same problem. How to resolve?
My computer is not an apple, the operating system is windows 7.
Mike DewarHard to tell and remember whether it's happening just to pre-itunes plus music. However, it's happening to many songs ripped from my personal CD collection. With 10,000+ songs transferred from my own CD's I'm not high on re-ripping the entire collection.
This seems to have happened in the past 6-12 months and can't help but wonder if one of the upgrades to iTunes somehow corrupted some file or meta data that is causing this effect.
Gary -
My Iphone was sync with Itunes on a computer then this computer broke down and i purchased another one. I was able to extract all the data from the old one. now how can i sync my phone with the new tunes without loosing any data?
Yes, windows to Mac too.
iTunes: How to move [or copy] your music [library] to a new computer [or another drive] - http://support.apple.com/kb/HT4527
Quick answer if you use iTunes' default preferences settings: Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive. Open iTunes and immediately hold down the Option (alt) key (shift on Windows), then guide it to the new location of the library.
Windows users see tip at: https://discussions.apple.com/message/18879381 -
I have just upgrade Itunes (10.6.3.25) and now I can not see my Ipad anymore. before the upgrade it was working fine. I already tried all suggestions from the support page, except re-installing Itunes. any suggestions?
SinluFrank wrote:
already tried all suggestions from the support page, except re-installing Itunes. any suggestions?
Yes. Reinstall iTunes. If that is the point at which you stopped trying the support suggestions then it makes sense to me, that you move on to the next suggestion and if reinstalling iTunes is the next suggestion, so be it.
However .... I too have issues that arise out of the blue with my iPad being recognized in iTunes and what I always do and it eventually works is to quit iTunes, restart my MacBook, and reboot my iPad.
Rebooting the iPad is the last thing that I do and only if I have no success with quitting iTunes and restarting the Mac. It may take a few tries to work, but if you are that dead set against reinstalling iTunes, then give it a try. -
I just bought an iPhone 4s yesterday and it wouldn't connect to the iTunes 10.6.3 I had already on my laptop for my husbands 3gs and my brother in laws iPhone 4. Neither of them ever had a problem syncing with itunes. When I tried I was told to uninstall itunes and reinstall a 64bit version. Took several attempts but I finally got it. Then it said that I needed to upgrade my apple mobile device support and for me to uninstall itunes again and reinstall it. I have done all of this several times and still cannot get it to work right. I have uninstalled every Apple software listed on my computer and had to reinstall it all. Help!!!!!!!
Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
http://www.apple.com/itunes/download/
Download and install the free trial version of WinRAR:
http://www.rarlab.com/
Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
(If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.) -
I have to extract all files from a hard drive of a macbook pro that is no longer working. All I have to access the hard drive is a PC, is this possible, and if so how?
You could try Paragon HFS+ for Windows. That would allow you to read and write files from a Mac-formatted drive.
Clinton -
My Black Macbook froze using Safari. I forced quit and restarted. Before the chime, there was a single buzz, from below the keyboard. What's that all about?
http://support.apple.com/kb/HT2341
Might be RAM related if the above tip describes what happened.
If not, and your data is not backed up, and it won't startup, read this tip:
https://discussions.apple.com/docs/DOC-1689 -
I download a suggested "update" from the App Store for my iPhoto yesterday. Now when I try and open my iPhoto, I get a grey screen with the rotating circle icon in the middle......that just keeps rotating. Ergo, it won't open!!! Before the "download" all was fine in Heaven & Earth....now, I'm a little peeved.
Anyone have a suggestion?
Thanks,
Wayne K.
ps Have a good day, God Bless America ...............and be weary of iPhoto update downloads,very weary.No need to be wary of iPhoto updates however it is a good idea to follow the instructions when updating. I haven't updated iPhoto from the App Store before however it should not be much different than doing a DVD update. Here are instructions on updating the library:
http://support.apple.com/kb/HT4431 -
I can't do this iCloud thing, I just do not get it! I looked at so many instructions to try and help me and nothing seems to work. All I want to do is copy and paste all my photo's and videos as I used to before the iphone updated to iOS. Can you help me? P
I've tried looking for the devise in My computer but all it says is iCloud. I really want to find the DMIC folder and I don't know how!Emma Norton wrote:
I've tried looking for the devise in My computer but all it says is iCloud.
You should not see anything labeled iCloud in Windows Explorer.
Maybe you are looking for
-
Apps not updating after upgrading to iOS 6
After updating my iPhone 4 to iOS 6, I am unable to update any apps. The App Store says they are downloading, but nothing happens, all the apps say "waiting" underneath them. This has been over four hours now. Anyone have any ideas?
-
Submit button in form will not send info to email
I had a friend build a website in Dreamweaver CS5.5. Now that it is live, I can't get the "send" button on the form to send the information to my email.There is a sendmail.php set up. Any help would be much appreciated...Thank you. The page is http:/
-
wat port number do v use for microsoft active directory server
-
LabVIEW executable not runnable when using asynchronous call
Hello, my project works fine from source, but fails to launch as an executable. I was able to track it down to the async call of an VI. So far I was able to solve the problem by using a dummy queue and loop to be able to start the VI parallel to the
-
I need contact sheet and database.
I have a musician's referral service on a website and I need a way for the info they fill out on the contact sheet to be imported into a database. I need a fast and easy way to do this. It all seems so complicated to me, one not familiar with this te