String extraction

Hi

How can I extract the first line form a multi-line string?

Many Thanks

Regards 


0
John
8/27/2007 10:50:53 AM
access.queries 6343 articles. 1 followers. Follow

4 Replies
815 Views

Similar Articles

[PageSpeed] 40

hi John,

John wrote:
> How can I extract the first line form a multi-line string?
Use Left(yourString, InStr(yourString, Chr(13) & Chr(10))) to get the 
first line.


mfG
--> stefan <--
0
Stefan
8/27/2007 11:09:56 AM
"Stefan Hoffmann" <stefan.hoffmann@explido.de> wrote in message 
news:uDOmMrJ6HHA.1208@TK2MSFTNGP03.phx.gbl...
> hi John,
>
> John wrote:
>> How can I extract the first line form a multi-line string?
> Use Left(yourString, InStr(yourString, Chr(13) & Chr(10))) to get the 
> first line.

Or Split(yourString, Chr(13) & Chr(10))(0)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)



0
Douglas
8/27/2007 11:14:32 AM
MyStringVariable = Left(MultiLine, Instr(MultiLine, vbCrLf) - 1)

"John" <John@nospam.infovis.co.uk> wrote in message 
news:ujNtfgJ6HHA.5160@TK2MSFTNGP05.phx.gbl...
> Hi
>
> How can I extract the first line form a multi-line string?
>
> Many Thanks
>
> Regards
> 


0
Stuart
8/27/2007 11:16:06 AM
hi Stuart,

Stuart McCall wrote:
>> How can I extract the first line form a multi-line string?
> MyStringVariable = Left(MultiLine, Instr(MultiLine, vbCrLf) - 1)
As the OP has posted it also in mpa.queries:

The VBA constant vbCrLf is not available in a query and must be replaced 
with Chr(13) & Chr(10) in that case.


mfG
--> stefan <--
0
Stefan
8/27/2007 11:58:21 AM
Reply:

Similar Artilces:

Search a string in all worksheets ?
I am searching for a string say ABC in all worksheets in Excel 97. However, it seems that it only allows me to search it in the current worksheet. Is there any suggestion ? Hi Peter............ In XL2k, I just highlighted all three sheets using Right-click on one tab and choosing Select all sheets..........then did Edit > Find > and typed my search string in the window and hit "Find next" repeatedly and it cycled through all three sheets finding the string...........is that what you're wanting to do? Vaya con Dios, Chuck, CABGx3 "Peter" <anonymous@di...

XmlTextReader to a xml string
I want to use FOR XML in my query so I'm going to use the ExecuteXmlReader method? The trouble I'm having now is streaming the results to a string for output as an XML document. Also, since the XML that comes from teh query is not a complete document it's a fragment without a root element. So, any ideas about how to get his into a string? --Buddy Buddy Ackerman wrote: > I want to use FOR XML in my query so I'm going to use the ExecuteXmlReader > method? The trouble I'm having now is streaming the results to a string for > output as an XML document. Also, ...

How to extract multiple rows based on data in one column
I work at an insurance brokerage where we can download payment statements in an Excel format. We would like to search a list of policy numbers (as a group vs. individually) and then extract the entire row the policy number falls in into another spreadsheet. Is there a way to do this? You would normally use VLOOKUP to do this, assuming the policy number is in the first column of your data - if not, then you would use and INDEX/MATCH combination. However, both VLOOKUP and MATCH will only find the first match - I'm a bit confused as your heading talks about extracting multiple rows, so do yo...

How can you copy selected cells when one cell contains a specified string?
Hi! I need to paste selected cells into different worksheets. The cells contain information like: date, amount, category eg: 24/08/04, 590, eggs 25/08/04, 430, cheese what I wanna do is copy date and amounts to eggs worksheet or cheese worksheet, depending on whether category is eggs or cheese. Is there a way to combine the IF function with a paste link, or something like that? Thanks a bundle in advance! Jon. Formulas return a value to the cells in which they reside. They cannot perform actions, such as copy,paste ect. what you want is possible but you didn't not provide enou...

Extract icon from *.exe
Hi all; In XL2000 I've created a ControlPopUp menu on the main toolbar of XL, listing the files in a specific directory and its subfolders(namely, My Documents folder). How can I extract the icon of the files listed in menu items and use the extracted icon as a FaceID of the menu, by VBA ? Thanks all. No chance you'd be satisfied using a faceid that's "close enough" like 66 for Excel files? -- Jim Rech Excel MVP <raider@mail.koc.net> wrote in message news:1105706670.372774.238800@c13g2000cwb.googlegroups.com... | Hi all; | | In XL2000 I've created a Con...

utility for extracting email addresses from database
i will like to be able to extract all the users email address of my organization from the exchange database. Does anyone know of any utility out there that can extract that report to some sort of file. Mikeolo "mikeolo" <afaras@netzero.net> wrote: >i will like to be able to extract all the users email >address of my organization from the exchange database. >Does anyone know of any utility out there that can >extract that report to some sort of file. > >Mikeolo Depends on the version of Exchange. In 5.5 you can run Exchange Admin and do a directory ex...

How do I write a string in the destination element depending on what the string is in the source, using XSLT/XPath? (Like a switch statement.)
Is there something like a switch statement in XPath? What I want to do is this: In the source there is an element called "member" with either the value "0" or "1". In the destination element (also called "member") the value should be "No" or "Yes" (Where "0" corresponds to "No" and "1" to "Yes"). How do I do this? Joakim Olesen wrote: > Is there something like a switch statement in XPath? What I want to do is > this: > > In the source there is an element called "member&quo...

Stringing formulas again
Hey there Roger, once again this formula thing is driving me crazy...I can visualize what I want to do but can't work out the formula...This is how I see it in my mind =IF(AI13,AW13,BI13,BW13,CJ13="N","",IF(AI13,AW13,BI13,BW13,CJ13="R","",SUM(AI13+AW13+BI13+BW13+CJ13/100)))) What do you think? Cheers David Perhaps this will help........... =IF(OR(AI13="N",AW13="N",BI13="N",BW13="N",CJ13="N",AI13="R",AW13="R",BI13="R",BW13="R",CJ13="R"),""...

Extracting data from an excel spreadsheet
Please can anyone help with me with some VBA Coding for an excel spreadsheet. I need to extract the year 2010 data from a master file copy it to a new spreadsheet, and need to keep it linked. They have set up the spreadsheet with blank rows and also wants to keep the all the formatting. Paste linking does not work for her. Can anyone please help me with some VB Coding to do this job, as I am really not sure how to even start this. Any help would be appreciated. -- Thanks BAC BAC I can help. I will need the following items. 1. A copy of the "master fil...

I want to create a Macro to extract informatin from other softwares like Chainlinx etc
Hi, Is it possible to create a macro to extract information from other softwares like Chainlinx, PMS etc.? If yes, could you please explain briefly, how to do it? Thanks. ...

How to find a text in a string without giving the position of the
My requirement are I want to find a particular text in a string with out giving the position of the text . I believe that if we use find and search we have to give the text position for the particular text. Can anyone guide me what should be the function used for getting this. Post example(s) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Sreekanth" <Sreekanth@discussions.microsoft.com> wrote in message news:B2ABF7FC-5745-4863-AA05-4EC1D61C825E@microsoft.com... > My requirement are > I want to find a particular text in...

String of strings
Is there a standard way of handling a double null terminated string with embedded null terminated strings. I've looked but can't find any examples. TIA, Gerry Murphy You have to manully put them in string, I believe you are looking for MutliSz reg string or string for shFileOperation if i am not wrong. -- With Regards Alok Gupta Visit me at http://alok.bizhat.com "I Believe this will Help" "Gerry Murphy" <gerrymurphy@rcn.com> wrote in message news:YNydnaPkJaUXCc7fRVn-uQ@rcn.net... > Is there a standard way of handling a...

Count occurance of a string across numerous worksheets
Hi all, Have a "Control Page" and numerous other sheets. I've now listed all workseets on the "Control Page" eg: .. A B 10 Feb04-Mar04 11 Jan04-Feb04 12 Dec03-Jan04 13 Nov03-Dec03 14 Oct03-Nov03 15 Sep03-Oct03 16 Aug03-Sep03 17 Jul03-Aug03 18 Jun03-Jul03 19 May03-Jun03 20 Apr03-May03 21 Mar03-Apr03 22 Feb03-Mar03 23 Jan03-Feb03 24 Dec02-Jan03 25 Nov02-Dec02 Im trying to count the number of times a specific string "Internet Usage - Prepaid IP Hours &q...

Searching for Substrings Within Strings
I would like to be able to search and flag a list of string data based on another list of substring data. If I have a list of strings in Column A and input the list of substrings in Column C, I would like an "X" to appear in Column B every time that a substring mentioned in Column C is included in any of the strings indicated in Column A. (There cannot be multiple instances of the same substring, or a combination of different substrings, in each string of data in Column A.) For instance, given the following information indicated in Columns A and C, the "X" should appear a...

Cheque printout to a file with date & amount converted to text/string
Print cheque output a text file, and this text file will be sent to bank for further processing. There are some fields are hardcoded and some are from GP fields, including date and amount. We modify the Report Writer for the Cheque printing, the added a few of calculated fields. Some calculated fields will contain text with hardcoded data (may contain special characters, like comma and /) Some calculated fields will hold data from the field found in GP and if it is date format, it will be using RW_DateToString() to convert it to string text and this calculated can be showing in...

Syntax Error in a SQL string
Can someone spot the syntax error in this SQL string? I tried, but could not see where it is. Thanks in advance, Paulo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Set qdfTemp = CurrentDb.CreateQueryDef("Current Orders Set", _ "SELECT IIf([Orders]![Status]='REC',[Orders]![DC Cims Week Actual],[Orders]![ETA to DC Cims Week]) " & _ "AS RelevantWeek, Sum(Orders.[Order Qty]) AS [SumOfOrder Qty], Sum(Orders.[Received Qty]) AS [SumOfReceived Qty], " & _ "Sum(IIf([Orders]![Channel]='WHOLESALE',IIf(...

How do I remove * from text string in cell
I need to remove the asterisk character from a text string within Excel but ordinary find/replace just sees it as a wildcard and deletes everything. Hi Search for ~* and it should work. HTH. best wishes Harald "Sue" <Sue@discussions.microsoft.com> skrev i melding news:15AB8A9C-4C55-4653-94DE-3D2DC2C2BEA8@microsoft.com... > I need to remove the asterisk character from a text string within Excel but > ordinary find/replace just sees it as a wildcard and deletes everything. ...

RecordsetClone SQL string
I am trying to retrieve the RecordsetClone SQL string form a filtered form. I just can't get a handle on how to do this. Thanks "DataCorp" <kurt @at dataman.cc> wrote in news:Z-WdnQGjTO2On_nanZ2dnUVZ_v-hnZ2d@bresnan.com: > I am trying to retrieve the RecordsetClone SQL string form a > filtered form. > > I just can't get a handle on how to do this. > > Thanks > That's because there is no handle. use the form's recordsource property to determine the name of the query, then go through the querydefs collection to retrieve the SQL. ...

Inserting Variables in String
I don't even know if I am using the proper terminolgy but here goes. I have three columns of variables that I would like to insert in a URL at specific points. I will try to describe what I am trying to do here in the following example: Cell A1 62.987 Cell B1 94.256 Cell C1 Alfrey Cell D1 http://www.mydomain.com/abcdVarA1efghVarB1hijkVarC1lmn.htm The above shows only Row 1 of many rows. I would like to insert the contents of A1 into the URL taking the place of "VarA", insert the contents of cell B1 into the section that says "VarB" and the contents ...

XmlSerializer and multi line strings
Hello, can somebody tell me how to serialize/deserialize a object containing a multi line string using the XmlSerializer class. One of the both windows linefeed chars get dumped somewhere down the road. It would be awesome somebody could answer this, sadly most of my questions don't get answered. Regards, Frank "stax" <agfagfagfaf@fdghsgsgs.de> wrote in message news:d60um1$lsj$1@online.de... > One of the both windows linefeed chars get > dumped somewhere down the road. Look at the XML at each point down the road to figure out where the problem lies. > can som...

Converting from string to integer, integer to string, string to float, float to string
Hi All, How can I perform these conversion functions? I use Visual C++ 6.0 and I want to use available libraries, not to go downloading some other ones from the web and not to do some myself. I found myself StrToInt and StrToInt64Ex. How about the other ones? Regards, Nicolae On Mon, 1 Nov 2004 01:21:05 +1100, "Nicolae Fieraru" <nospam@please.com> wrote: >Hi All, > >How can I perform these conversion functions? I use Visual C++ 6.0 and I >want to use available libraries, not to go downloading some other ones from >the web and not to do some myself. &g...

extract all the text from a email in outlook
Hello everybody :: I have a problem with a email that I have receive, and insulting email. I contact with the sender person and he promise that he has not sent this email form his account, neither he have in is outbox, neither he think anyelse could have use his account . So i would like to see the full original text from the email (the one that is sended form server to server) to see if there is really true what is going on I mean something like the "show original" option in Gmail account if anybody know, i would be very gratefull to it thanks in advance ---- it should look ...

Error Sorting Strings
I'm trying to sort the below table by numbers first, then string-only records. The numeric records will come first, a double digit "10" sorts before a single digit "4", etc. I've tried several suggested methods but I'm getting a string conversion error. Can someone take a look at this DDL and explain how can I test each string to see if it begins with a number and then sort as I described? The error is "Error converting data type varchar to numeric." DDL ================ IF object_id('tempdb..#tmpMyTable') IS NOT NULL B...

How do I get a string from the string table?
Is there a routine to get a string from the string table, where you give it the ID and it returns a char* or CString? Chris Baker wrote: > Is there a routine to get a string from the string table, > where you give it the ID and it returns a char* or CString? CString sText; sText.LoadString( IDS_HELLOWORLD ); Simon "Chris Baker" <ChrisBaker@discussions.microsoft.com> wrote in message news:<3068961C-0752-4983-8274-6C43128C5006@microsoft.com>... > Is there a routine to get a string from the string table, > where you give it the ID and it returns a char* or...

Converting STRINGS into FORMULAS
really needing this... let's say A1 = "SUM" B1 = "(" C1 = ")" D1 = "A3:C8" How can I put everything together and get the FORMULA =SUM(A3:C8) and its result INSTEAD of the STRING "=SUM(A3:C8)"? it's drivinhg me mad....I've tried CONCATENATE, &,... and all I get is the string... Thanks a lot Dario - Brazil Why? Would this satisfy your need? =SUM(INDIRECT(D4)) -- Don Guillett SalesAid Software donaldb@281.com "Dario Jardim Junior" <dario.jr@uol.com.br> wrote in message news:OOiO0VzxDHA.2396@TK2MSFTNGP10.p...