Recently I had a Problem with Splitting a HTML string into separate columns in Access 2010 and store date in SQL server 2008R2 table. This works more or less because the number of lines varies.
To avoid storing the HTML-tags I have a easier solution, I use a text field in Access which is Formated as Standard while the other text-field is formated as rich-text to contain the Format.
Inserting the same content, which is copied from a HTML mail in the Standard text field maintains the LINE FEED !
How can I "detect" which character is it to replace it by another character for further use??
Example:
<div><font face=Arial size=3 color=black>Customer Name</font></div>
<div><font face=Arial size=3 color=black>Customer Address</font></div>
<div><font face=Arial size=3 color=black>12345 City</font></div>
is the copied Content from html mail and inserted into the rich-text field.
If I copy this Content to a Standard text field it Looks like this:
Customer Name
Customer Address
12345 City
In the Server table the Content of the field Looks like this
Customer Name Customer Address 12345 City
But to maintain the line feed in the Access field there must be any character, but which??
Thanks!
Michael
In the SQL-Server table, multiple rows are shown as one row. If you set the ControlSource property of the Access TextBox to that column, it will be shown with multiple lines.
If you still want to know the characters: It's a combination of the ASCII control characters CR and LF (chr(13) & chr(10) or vbCrLf or vbNewLine). In SQL-Server syntax it's CHAR(13)+CHAR(10).
Related
I'm facing the issue in ADF copy activity while loading the CSV data to the snowflake table,
The issue is while loading the CSV file to the snowflake table using the ADF COPY ACTIVITY, it is treating data of a single column as a multiple columns data,
for example: "My brother often watches different cricket shows on different ""screens"", but on the same different platform"
This is the value of single column_A but ADF copy activity is reading as a value for two-column instead of one
i.e col_A=My brother often watches different cricket shows on different ""screens"
col_B= but in the same different platform
But I want this value to be in single-column i,e column_A
column_A="My brother often watches different cricket shows on different ""screens"", but on the same different platform"
Any alternatives I could do for this?
In your source data, the column value contains comma , and double quotes " which are the same as your dataset properties column delimiter and Quote character.
Column delimiter is to separate the column based on the given delimiter value.
If the column value also contains the same delimiter character, the quote character is used to identify the complete value as a single column
Example:
sample data : "1,abc",def
Preview of data in Azure Data Factory dataset:
In your case you have both column delimiter and quotes character within your column value, so it is not identified as a single column but instead separated into 2 columns based on dataset property values (comma , and double-quotes ".)
Your sample data :
"My brother often watches different cricket shows on different ""screens"", but on the same different platform"
To fix this you can change the column delimiter in your source file or replace double quotes within column value with something else.
Example:
I have a CSV file I am attempting to create, and the recipient requires a header row. In this header row (and in the data) there is a field that used to be present that was removed. However, they did not remove the column that that held that data, so now, there is an empty column name surrounded by delimiters ("|"). How can I recreate this?
The expected results for the following columns should be:
RxType1|RxType2|RxType3|RxType4|RxType5||DelivID
(There is an empty column between RxType5 and DelivID) and the results would be:
|Rx|OTC|Legend|Generic|Other||Express
I am using SSRS, and have attempted adding an extra pipe the the column header for RxType5 with an empty column behind it, but the CSV seems to generate a header row based on the column names from the stored procedure and not from the RDL data. I have also attempted in the Stored Proc to create the column by using:
Select
'' AS ""
OR
'' AS "|"
but when I refresh the fields in SSRS, it puts that the column is called "ID_" (because a space, no character, or pipe is non-CLS compliant.
Any suggestions on how I can achieve this? Thanks so much :)
Try creating the column with a known name, like SELECT '' AS [RemoveMe], and then just remove that name from the row header text box.
In my stored procedure I use string entered by the user in the application to create column names in a table. The string has no limitations in the application. Is there a way (function maybe) to convert the string so that it fits the Column Name limitations? I know that I can do REPLACE to remove HTML and special chars but I am looking for a solution that it will somehow guarantees that the converted string can be placed as Column Name.
I dont want to limit the user in the UI because the entered string can be used in other parts of the application where for example HTML chars are important
Example: String edited by the user: Cat's <b>name</b> . I wont to be converted to a valid column name string.
Background: I need to generate a text file with 5 records each of 1565 character length. This text file is further used to feed the data to a software.
Hence, they are some required fields and optional fields. I created a query with all the fields added together to get one single field. I populated optional fields with a blank.
For example:
Here is the sample input layout for each fields
Field CharLength Required
ID 7 Yes
Name 15 Yes
Address 15 No
DOB 10 Yes
Age 1 No
Information 200 No
IDNumber 13 Yes
and then i generated a query for each unique ID with the above fields into a single row which looks like following:
> SELECT Cast(1 AS CHAR(7))+CAST('XYZ' AS CHAR(15))+CAST('' AS CHAR(15))+CAST('22/12/2014' AS
CHAR(10))+CAST('' AS CHAR(1))+CAST(' AS CHAR(200))+CAST('123456' AS CHAR(13))
UNION
SELECT Cast(2 AS CHAR(7))+CAST('XYZ' AS CHAR(15))+CAST('' AS CHAR(15))+CAST('22/12/2014' AS
CHAR(10))+CAST('' AS CHAR(1))+CAST(''AS CHAR(200))+CAST('123456' AS CHAR(13))
Then, I created an SSIS package to produce the output text file through Flat file destination delimited.
Problem:
Even though the flat file is generated as per the desired length(1565). The text file looks differently when the word wrap is ON or OFF. When Word wrap is off , i get the record in single line. If the Word wrap is on, the line is broken into multiple. the length of the record in either case is same.
Even i tried to use VARCHAR + Space in the query instead of CHAR for each field, but there is no success. Its breaking the line for blank fields.
For example: Cast('' as varchar(1)) + Space(200-len(Cast('' as varchar(1)))) for Information field
Question: How do make it into a single line even though the word wrap is ON.
Since its my first post, please excuse me for format of the question
The purpose of word wrap is to put characters on the next line in instances of overflow rather than creating an extremely horizontal scrolling document.
Word wrap is the additional feature of most text editors, word processors, and web browsers, of breaking lines between words rather than within words, when possible.
Because this is what word wrap is there's nothing you can do to change its behavior. What does it matter anyway? The document should still be parsed as you would expect. Just don't turn word wrap on.
As far as I'm aware, having word wrap on or off has no impact on the document itself, it's simply a presentation option.
Applications parsing a document parse it as if word wrap were off. Something that could throw off parsing is breaks for a new line, but that is a completely different thing from word wrap.
I hope someone can help. My database was infected by a virus which inserted a string of characters into virtually every text and varchar field.
Before the virus, data was stored like "San Diego Football Team".
After the virus, data reads like "San Diego Football Team - plus a string of HTML characters, style sheet content, url's, etc."
I can't include what the tags are because they will not be rendered in this message.
To complicate matters, the additional information is random strings of HTML tags (w/data) so it's difficult to identify patterns. Luckily, all of the inserted text starts with the title tag (w/brackets). Any suggestions for to remove this text easily? We have roughly 500k records.
Many thanks for your help.
Jim
Try this to get rid of appended text
update #table set
firstname = SUBSTRING(firstname, 0, CHARINDEX('<title', firstname, 0))
Where
CHARINDEX('<title', firstname, 0) > 0
This is assuming the text is at the end of actual original text. Try this with a column first and extend it to other columns.
Use this with caution!