Jump to content

Retrieving strings from a paragraph of text


This topic is 6568 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi guys,

I have a problem, i have this chunk of information below in which i have to retrieve the value of the 'Drive Model Number' & 'Drive Serial Number'

and split them into their respective field textboxes.

Is it possible that i skip the first line and go to the 3rd line of the passage below and retrieve the details after the semicolon?

Any help is greatly appreciated! Thanx!

----------------------------------------------------

Primary Controller - Master drive

Drive Model Number________________: QUANTUM FIREBALLlct10 10

Drive Serial Number_______________: 872008050170

Link to comment
Share on other sites

Hi prissypan,

[color:"red"] I answered this in the other post, which makes this a double post in reality. Here is my answer from there.

Hi Harry,

These seem to work, but it will depend on the structure of the text in reality.

c_DriveModel, calculation, Text Result

Trim(Middle(DriveFieldText, Position(DriveFieldText, "Drive Model Number________________: ", 0, 1) + Length("Drive Model Number________________: "), (Position(DriveFieldText, "Drive Serial Number", 0, 1) - (Position(DriveFieldText, "Drive Model Number________________: ", 0, 1) + Length("Drive Model Number________________: ")) - 1 )))

c_DriveSerialNum, calculation Text Result

Trim(Case(PatternCount(DriveFieldText, ":") = 2, Right(DriveFieldText, Length(DriveFieldText) - Position(DriveFieldText, ":", 1, 2)), PatternCount(DriveFieldText, ":") >2, Middle(DriveFieldText, Position(DriveFieldText, ":", 1, 2) + 1, Position(DriveFieldText, ":", 1, 3) - (Position(DriveFieldText, ":", 1, 2) + 1))))

Change the field "DriveFieldText" in these calculations to the name of your field.

HTH

Lee

p. s.

These are pretty ugly, hopfully some one with more abilities than me will streamline them.

wink.gif

Link to comment
Share on other sites

Hi Lee,

I understand that this post is similar to the previous post before mine, but there is so much text that i got very confused.

Thank you so much, the codes above, its simply the best.

Its lucky we have people like you around.

Thank you so so much

Cheers,

Prissy

Link to comment
Share on other sites

This topic is 6568 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.