View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cardan cardan is offline
external usenet poster
 
Posts: 112
Default Extracting Specific Numbers in a String of Text

Hello,

I have what I think may be a simple question. I am working with some
XBRL. The way I am going about this problem is not the intent of the
code but it is a workaround. If someone can help me put the code into
excel and have it work properly I am all ears! Anyways,
I am copying and pasting strings of text (actually lines of xbrl code)
into an Excel worksheet. Each copy/paste is about 1000 rows long. Each
string comes in under one cell and is different in length but the
format is the same. Example lines are below. I need to extract out
the tag (RIAD4461 for example) and the number at towards the end that
is between brackets ###<. With my limited knowledge I can get the
RIAD4461 number with a left(cell,9) and then a right(cell,8) However I
am not sure how to get the number given their different number of
characters. Any help would be greatly appreciated.

Example Lines of Code
line 1* <cc:RIAD4461 contextRef="CD_508878_2008-09-30" unitRef="USD"
decimals="0"169000</cc:RIAD4461 (end line 1)

line 2 <cc:RIAD4462 contextRef="CD_508878_2008-09-30" unitRef="USD"
decimals="0"443000</cc:RIAD4462 (end line 2)

line 3* <cc:RIAD4463 contextRef="CD_508878_2008-09-30" unitRef="USD"
decimals="0"97000</cc:RIAD4463 (end line 3)