Removing the strings between two characters in excel - excel

I have a large excel data sheet with thousands of rows and its filled with html codes with less than and greater than tags containing codes and other real information is outside of tags. Like;
Cables Supported </TD> <td class="specDetail fs18" data-selenium="specDetail"> RG-6 coax </TD> </TR> <tr> <td class="specTopic fs18" data-selenium="specTopic"> Weight Supported </TD> <td class="specDetail fs18" data-selenium="specDetail"> 80 lb (36 kg) </TD> </TR> </TBODY> </TABLE> <table class="specTable" data-selenium="specTable"> <tbody data-selenium="specBody"> <tr> <th class="specHeader Header" colspan="2" data-selenium="specHeader"> <a name="shipping" class="fs32 OpenSans-300-normal" id="shipping" data-selenium="specHeaderLink">Packaging Info</A> </TH> </TR> <tr> <td class="specTopic fs18" data-selenium="specTopic"> Package Weight </TD> <td class="specDetail fs18" data-selenium="specDetail"> 0.05 lb </TD> </TR> <tr> <td class="specTopic fs18" data-selenium="specTopic"> Box Dimensions (LxWxH) </TD> <td class="specDetail fs18" data-selenium="specDetail"> 3.3 x 2.0 x 0.2" </TD> </TR> </TBODY> </TABLE> </DIV> </DIV> <div class="rightPanel"> <div class="video-container"> <div class="content" data-selenium="content"> <script src="//players.brightcove.net/1661991858001/N1cfLQmFe_default/index.min.js" type="text/javascript"></SCRIPT> </DIV><!-- end content --> </DIV> </DIV> </DIV>
I need to remove everything inside "<" ">" including the less than and greater than characters. So at the end, result should look like this:
Cables Supported RG-6 coax Weight Supported 80 lb (36 kg) Package Weight 0.05 lb
Box Dimensions (LxWxH) 3.3 x 2.0 x 0.2"
Data to columns won't with that large data. It just doesn't fit. I'm stuck.

i cant write the formula properly freehand and dont currently have access to excel so this may need some name function name changing and possibly attribute order changing but it would look something like
=replace(a1, left(right(a1, find(a1,"<")),find(a1,">")),"")
which should do the following in pseudo code
s = string
m = position of first >
n = position of first <
o = the text to the left of the m'th letter of s
p = the text to the right of the n'th letter of o
replace p from s with ""
then copy the column with the formula in and past special (values) into the original string column until there are no more < or > (or record a macro to do that then either spam the key or edit it and surround the macro with a loop.

Related

bootstrap grid columns divide into separate rows with each second row split into separate columns and at the center

I am getting started with bootstrap grid and am trying to get this layout ready.[![enter image description here][1]][1]
I am a bit confused about how to divide the the three main columns into separate parts so I can place the corresponding text/images as shown in the figure
I started creating a basic layout but I am not able to get it to the right point:
<div class="row" style="border: 1px solid;">
<div class="col-xs-4">
<div class="col-xs-12 col-md-offset-4">
XXX
</div>
<div class="col-xs-12 ">
<div class="col-xs-12 ">
first column second
</div>
<!--<div class="col-xs-12 ">
first column second
</div>-->
</div>
</div>
<div class="col-xs-4" style="border: 1px solid;">
<div class="col-xs-12 ">
second column first
</div>
<div class="col-xs-12 ">
second column second
</div>
</div>
<div class="col-xs-4" style="border: 1px solid;">
<div class="col-xs-12 ">
third column first
</div>
</div>
</div>
I tried to centralize the first row in the first column which seem to look OK. But then, I am not able to divide the second row into separate columns. And similar issues will be there for 2nd and 3rd columns. Can you give some pointers on how to go about getting the attached layout?
Bootstrap works using a 12 column layout. So if you would like 2 equal columns you would need to set each value as 6.
Using your example for the second column you would put
<div class="col-xs-4" style="border: 1px solid;">
<div class="col-xs-6 ">
second column first
</div>
<div class="col-xs-6 ">
second column second
</div>
</div>
Thanks

In excel, calculate the hotel group pickup pattern using check in and check out dates

I receive large lists of names and check-in and check-out dates for groups at a hotel. Often times, I receive errors in the hotel system if I do not have an accurate number of rooms to save a list into.
What I need is an Excel formula that can calculate consistently the total number of rooms I will need for a given night using only the check-in and check-out dates provided.
I've tried "COUNTIFS" before:
=COUNTIFS(arrival-range,"{greater than/equal to"&DATE(yyyy,m,d),departure-range,"{less than/equal to}"&DATE(yyyy,m,d)but it doesn't accurately return the booking pattern of rooms booked per night.
Example: run code snippet for example tables of data
td {font-family: sans-serif; padding: 2; text-align: center;}
#have {display:inline; margin: 5;}
#have td {border: 1px solid blue;}
#want {display:inline;}
#want td {border: 1px solid green;}
.rmval {font-weight: bold; background-color: #eafceb;}
<table id="have">
<tr><td colspan="2">Rooming List</td></tr>
<tr id="label">
<td id="arrival">Arrival</td><td id="depart">Departure</td>
</tr>
<tr><td>01-Month</td><td>04-Month</td></tr>
<tr><td>01-Month</td><td>03-Month</td></tr>
<tr><td>02-Month</td><td>04-Month</td></tr>
<tr><td>02-Month</td><td>03-Month</td></tr>
<tr><td>01-Month</td><td>04-Month</td></tr>
</table>
<table id="want">
<tr><td colspan="2">Data I Want</td></tr>
<tr><td>Date</td><td>Number of rooms</td></tr>
<tr><td>01 Month</td><td class="rmval">3</td></tr>
<tr><td>02 Month</td><td class="rmval">5</td></tr>
<tr><td>03 Month</td><td class="rmval">3</td></tr>
</table>
Thanks in advance for help.
Searching for the number of bookings for a date present in C3, this formula should work unless something is missing in your question:
=COUNTIFS(A:A, "<="&C3, B:B, ">"&C3)
For today:
=COUNTIFS(A:A, "<="&TODAY(),B:B, ">"&TODAY())

JSF2 Primefaces datatable subtable or ui:repeat table

My data structure is like this:
ObjectA contains Strings varA, varB and a List of 24 ObjectBs.
ObjectB contains Strings varC,varD,varE.
I now have a List of ObjectAs.
I am trying to use a Primefaces datatable to get an output like this (in a table). (for each ObjectA)
How do I achieve this? In the screenshot below, the first column is the row index, the second column is the varA from ObjectA, third column is varB from ObjectA. Columns with headers 1 to 24 are the values of ONLY varC from each of the 24 ObjectBs. In the second row, columns with headers 1 to 24 are the values of ONLY varD from each of the 24 ObjectBs. In the third row, columns with headers 1 to 24 are the values of ONLY varE from each of the 24 ObjectBs.
After three rows are complete, now I take the next objectA2 and repeat the process. I was able to do this in a jsp using c:forEach tags. However, I am unable to get this done using JSF.
I even tried during normal HTML table using ui:repeat but if there are two ObjectB ui:repeats inside the ObjectA ui:repeat, only one of the ui:repeats is working and the other one is showing blank values.
<ui:repeat var="upto" value="#{getClearedTransactionsBean.clearedList}" varStatus="rowCounter">
<tr>
<td rowspan="3">#{rowCounter.index+1}</td>
<td><h:outputText value="#{upto.sink}"/></td>
<td>Cleared MW</td>
<ui:repeat value="#{upto.hourlyClearedList}" var="hourly">
<td><h:outputText value="#{hourly.clearedMW}"/></td>
</ui:repeat>
</tr>
<tr>
<td><h:outputText value="#{upto.sourceLocationLabel}"/></td>
<td>Source LMP</td>
<ui:repeat items="#{upto.hourlyClearedList}" var="hourly">
<td><h:outputText value="#{hourly.sourceLMP}"/></td>
</ui:repeat>
</tr>
<tr>
<td></td>
<td>Sink LMP</td>
<ui:repeat items="#{upto.hourlyClearedList}" var="hourly">
<td><h:outputText value="#{hourly.sinkLMP}"/></td>
</ui:repeat>
</tr>
<tr class="blankrow">
<td colspan="27"></td>
</tr>
</ui:repeat>
</table>
The above screenshot is the one that I did successfully in a jsp. But, I need to do this in JSF 2. Thanks !
Try to use dynamic columns. Prepare model for rows, may be object with columns data in HashMap.
http://www.primefaces.org/showcase/ui/data/datatable/columns.xhtml

How can I make a column in a sharepoint report hidden unless the field is populated?

I have a report in Sharepoint that I want to show the "End Date" field only if there is an end date. I'm using Knockout
<td class="ms-vb">
<b>End Date:</b>
</td>
<td class="ms-vb">
<span data-bind="text: EndDate"></span>
</td>
I just want this part of the report to only be visible if the endDate is populated. Otherwise I don't want it to be seen in the report.
I'm not sure what other information to provide, I think that's sufficient for you to understand my question.
Thanks,
When using knockout.js, you can use the visible binding to hide some content based on the end date:
<tr data-bind="visible: EndDate() != null">
<td class="ms-vb">
<b>End Date:</b>
</td>
<td class="ms-vb">
<span data-bind="text: EndDate"></span>
</td>
</tr>
You can use the visible binding, documented (with examples) here.

Getting Counted Values of a Multi-Value Lookup Column in DVWP using XSLT

I am in the process of building a "dashboard" where I am using DVWP's and XSLT to show the client things such as total count of tasks, how many open, how many closed etc. similar to this article
My issue is that I have a multi-value lookup column for which I need to get the count of the values, but I am not able to generate any results with what I have tried.
Any suggestions or recommendations on how to accomplish would be great.
So to add to the above as an update:
I am not exactly certain the best approach on how to achieve the desired results. Essentially I have a multi-value lookup column that currently has 20 values. The client has the ability to add new values when needed. So what I am attempting to do is to get a totals type count of the values they have selected for each record.
So let's say for example the lookup colum has five (5) values:
Value 1
Value 2
Value 3
Value 4
Value 5
In the newform.aspx they have the ability to select multiple values (so the could select value 3 and value 5; or value 2, value 4, and value 5 etc etc). In the list view it of course shows the selections as it should. What I am attempting to do is to get a total count of those values.
For example the output would look something like:
Value 1 : 5
Value 2 : 1
Value 3 : 2
Value 4 : 3
Value 5 : 6
Value 3 & 5 : 4
Value 2,4, & 5: 3
I am not certain about the XSLT to develop such a thing as I have not had to do this with such a complex Lookup Column before. Normally I would do someting like below, but this only gets me the basics, and since the values can be combined I am not certain how to approach:
<xsl:template name="dvt_1.body">
<xsl:param name="Rows"/>
<xsl:variable name="total1" select="count(/dsQueryResponse/Rows/Row/#MyLookupCol.[contains(.,'1;#Value1')])"></xsl:variable>
<xsl:call-template name="cs3_totalRow">
<xsl:with-param name="cs3_RowName1">
Value 1
</xsl:with-param>
<xsl:with-param name="cs3_RowValue1">
<xsl:value-of select="$total1"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="totalsRow">
<xsl:param name="RowName1"></xsl:param>
<xsl:param name="RowValue1"></xsl:param>
<table>
<tr>
<td>
<xsl:value-of select="$cs3_RowName1"/>:
</td>
<td>
<xsl:value-of select="$cs3_RowValue1"/>
</td>
</tr>
</table>
OK; figured it out. You will need to use MUENCHIAN METHOD which utilizes keys in order to generate something of a "distinct group by" list and then use count in your expression and count the keys.
References used are here and here
See the code below for details:
<!--GROUPING USING THE MUENCHIAN METHOD-->
<!--Add a key as shown below. This is important! Will not "group by" without it-->
<xsl:key name="YourKeyNameHere" match="Row" use="#YourColumnName"/>
<xsl:template match="/">
<!--Get your column values look you normally would-->
<xsl:variable name="cbs_Rows" select="/dsQueryResponse/Rows/Row/#YourColumnName"/>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr valign="top">
<th class="ms-vh" nowrap="nowrap">TheValueName</th>
<th class="ms-vh" nowrap="nowrap">ValueTotals</th>
</tr>
<!--This gets the distinct strings for you.-->
<xsl:for-each select="//Row[generate-id() = generate-id(key('YourKeyName', #YourColumnName)[1])]">
<xsl:sort select="#YourColumnName"/>
<xsl:for-each select="key('YourKeyName', #YourColumnName)">
<xsl:call-template name="Rows.RowView" />
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
<!--then build your row view-->
<xsl:template name="Rows.RowView">
<xsl:variable name="SortValue" select="ddwrt:NameChanged(string(#YourColumnName), 0)"/>
<xsl:if test="string-length($SortValue) > 0">
<tr id="group0{generate-id()}">
<td>
<xsl:value-of select="#YourColumnName"/>
</td>
<td>
<xsl:value-of select="count(key('YourKeyName', #YourColumnName))"></xsl:value-of>
</td>
</tr>
</xsl:if>
</xsl:template>

Resources