Embedding styles in plain text before inserting into Word - vba

Can I apply a style markup to plain text before I insert it into Word? Something like this?
<style = "normal">Line 1 of text
<style = "abc">Line 2 of text
<style = "normal">Line 3 of text
Then paste the whole thing.
Or do I have to
apply normal style, insert line 1
apply abc style, insert line 2
apply normal style, insert line 3
Hope this makes sense. Thanks

Related

R markdown unispace font after table

I am writing a markdown report and noticed that when I insert a table, subsequent text is unispace, even though I do not use the ` character to make it unispace.
I tried adjusting the number of spaces before the text following the table, the number of blank spaces between table and text and including formatting tags such as \textbf{} without success. An example of code is below
pre table text
Trial
Mean male mistiming (s)
Mean female mistiming (s)
Male time - female time (s)
1
a
b
c
2
a
b
c
c. Post table text: Do any trends exist?
Jitter plots ...
As shown in the plot below...
a screenshot of the produced report is below:
output
I would like the text after my table to be formatted similar to the text before the table (i.e. it should be in a normal (times) font with indentation and text wrapping).

Applying Cross Apply & String_split to column - SQL

I have data in the following format unfortunately I'm powerless to how the data comes in, the data looks like;
ID
Column X
1
I (a)Some Text (b)Some more Text (c) Text
2
1a Some Text b Some more text c
Is it possible to use Cross Apply and String split so data looks something like;
ID
Column X
1
(a) Some text
1
(b) Some more text
1
(c) Text
2
a Some text
2
b Some more Text
Ideally, the end goal once split will be to remove the a,b,c etc.
I'm using SQL Version; 2019 Dev

Power BI - Is there a way to conditionally format a text column if it does NOT meet a criteria?

as the title states, is there a way to conditionally format a text column if it does NOT meet a criteria - In Power BI?
i.e: Format a column's font colour if it is NOT "x".
e.g:
I want to format the following data (using the letter column) and highlight a, b and c (as they are not equal to x)
ID | code | letter
------------------
1 | 123 | a
2 | 345 | b
3 | 567 | x
4 | 789 | c
------------------
You can always create a measure to determine the desired highlight color for example, and use it, e.g. like this:
Measure = If(FIRSTNONBLANK('Table'[letter]; [letter]) = "x"; BLANK(); "#AABBCC")
See Color formatting by field value:
You can use a measure or a column that specifics a color, either using a text value or a hex code, to apply that color to the background of font color of a table or matrix visual. You can also create custom logic for a given field, and have that logic apply the desired color to the font or background.
You didn't mention what do you want to highlight and how. If the data will not be aggregated and show all rows in a table, you can calculate the highlighting color in conditional column in Power Query Editor, or computed column (DAX). If the highlighting rules will be applied on aggregated data, then you should use DAX measure.
If you want to highlight a cell, return the desired color. Otherwise return null in Power Query Editor, or BLANK() in DAX.

How to change color in a column in lazyhighcharts?

I am using LazyHighCharts in rails 3. My requirement is to show different color in a column.
when i use
series = {
:type=> 'bar',
:name=> [],
:data=> #rooms,
:color=> 'pink'
}
it displays whole column in pink color. Suppose i have 5 rows in a column and i want to show first row in pink color and the rest four row in green color. can anyone suggest me solution for this.
thnks
i don't know if you have resolved this issue, but this is how i resolved it.
#Controller before set data to the series option
data = []
your_array.each do |t|
data << {:y=>t.value, :color=>"#"+("%06x" % (rand * 0xffffff))}
end
then set data to series option
f.series({:name=>"Subcurso", :data=>data} )

Using bulk insert to import .csv file

I have a csv format file, which I want to import to sql server 2008 using bulk insert. I have 80 columns in csv file which has comma for example, column state has NY,NJ,AZ,TX,AR,VA,MA like this for few millions of rows.
So I enclosed the state column in double quotes using custom format in excel, so that this column will be treated as single column and does not split at comma in between the column. But still the import is not successful; still it is splitting at comma. Can anyone please suggest successful import of the columns containing comma using bulk insert
I am using this code
bulk insert test from 'C:\test.csv'
with (
fieldterminator=',', rowterminator='\n'
)
go
I saw similar question previously asked here, but I don't know visual basic to apply the code. Is there any other option to modify file in excel?
Is there any other option to modify file in excel?
It turns out there is, at least in Windows.
Go to Start Menu > Control Panel > Regional and Language Options.
In the Regional Options tab, click the Customize Button.
In the List Separator field, replace the , with a |. Click OK.
Saving a file as a .CSV through Excel will now create a pipe-separated value file. Be sure to undo this change to the Regional Options setting, as Excel uses the list separator for other things like functions.
Then you can do as datagod suggests and bulk upload the file using | as the column delimiter.
You should create a format file: http://msdn.microsoft.com/en-us/library/ms191516.aspx
If your data contains commas, I would choose a different delimiter. You can specify "|" as the delimiteter in the format file.
Example:
10.0
4
1 SQLCHAR 0 100 "|" 1 Col1 SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 100 "|" 2 Col2 SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 100 "|" 3 Col3 SQL_Latin1_General_CP1_CI_AS
4 SQLCHAR 0 7000 "\r\n" 4 Col11 SQL_Latin1_General_CP1_CI_AS