RE: Splitting field
Posted in 2006
I would do this in Unix. Unload the data, then use combinations of "wc -l" (count the lines in a file), "wc -w" (count the words in a line), head, tail, and awk (for extracting the columns) ....... should be able to do this in one script Probably not very efficient, depending on how big the file is, but it should do the trick -----Original Message----- > The information on this e-mail including any attachments relates to the official business of DigiCare (Pty) Ltd. The information is confidential and legally privileged and is intended solely for the addressee. Access to this e-mail by anyone else is unauthorised and as such any disclosure, copying, distribution or any action taken or omitted in reliance on it is unlawful. Please notify the sender immediately if it has inadvertently reached you and do not read, disclose or use the content in any way. > No responsibility whatsoever is accepted by DigiCare (Pty) Ltd if the information is, for whatever reason, corrupted or does not reach its intended destination. The views expressed in this e-mail are the views of the individual sender and should in no way be construed as the views of DigiCare (Pty) Ltd, except where the sender has specifically stated them to be the views of DigiCare (Pty) Ltd. > From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of Simmons, Keith Sent: 21 April 2006 03:24 PM To: Konikoff, Rob (Contractor) Cc: informix-list@iiug.org; emmermacher@hotmail.com Subject: RE: Splitting field Assuming the house number is always the first 'word' in the field, and consists ONLY of the first word in the fields. What happens where the house number is actually a house name of more that one word "Dun Roamin'" !!?? Keith -> -----Original Message----- -> From: Konikoff, Rob (Contractor) [mailto:rob.konikoff@us.army.mil] -> Sent: Friday, April 21, 2006 2:17 PM -> To: Obnoxio The Clown; Simmons, Keith -> Cc: informix-list@iiug.org; emmermacher@hotmail.com -> Subject: RE: Splitting field -> -> -> > -> How can I do this with my old IDS 7.30? -> > -> A streetname can contains numbers and some house numbers have -> > -> characters... -> -> 1. Unload your KEY and your ADDRESS column -> 2. Split the column based on white space, probably using AWK -> outside the -> database, or an offline standalone package that supports space -> delimiters, depending on the size/amount of records -> 3. ALTER table to include your new columns, ST_NUM and ST_NAME -> 4. Reload your new columns based on the KEY and plug in the new data -> 5. ALTER table to drop your old column of combined ADDRESS data -> 6. Pray your data integrity guys don't kill you -> -> Rob -> ************************************************************************ ********** This message is sent in strict confidence for the addressee only. It may contain legally privileged information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. This footnote also confirms that this email message has been swept for the presence of computer viruses, however we cannot guarantee that this message is free from such problems. ************************************************************************ ********** _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list