Trimmed Field
Hi
I have been using BarTender for a number of years (currently using Pro 10.0 SR4). I have run into a challenge with my current project.
I am using a delimited text file with a header record and a number of fields.
These fields have a variable paragraph along with barcode information.
The challenge that I am encountering is, when the data is imported into the database (User defined delimiter is ~), any field with leading blank characters are trimmed -- left trimmed.
For example,
Source data looks like:
SeqNum~Para1_1~Para1_2~
000001~This is the start of a line~ continuing with two leading spaces~ ....
When loaded into the database:
SeqNum is assigned: 000001
Para1_1 is assigned: This is the start of a line
Para1_2 is assigned: continuing with two leading spaces
where Para1_2 has the leading spaces removed.
Is there a way of retaining these leading spaces?
Thank you in advance for your assistance.
-
Shotaro Ito
★ BarTender Hero ★
Because leading space will be trimmed when the data is taken from database,
There's no way retaining leading spaces when you use custom delimiter.
I recommend to create data by mixed quote and comma delimiter (CSV) and quote text field by "".
To do that, modify creating application or use any software to convert text data, by inserting " at start of line, replace ~ by "," then inserting " at end of line etc.
There's many free / paid software would do such job, often called GREP.
0 -
Unfortuntely, my data may contain single quotes, double quotes and
commas.... this is the reason that I used a ~ as the field delimiter....As a quick fix, I split the last word from the first field then added the remaining part of the last word and the
spaces in the second field....For example,
The source data looks like:
SeqNum~Para1_1~Para1_2~
000001~this is the start of a li~ne continuing with two leading spaces~
It works but I was hoping for a cleaner solution.
Thank you for your comments
0 -
Shotaro Ito
★ BarTender Hero ★
That's truly creative!
In CSV (Mixed Quote and Comma) format, you can insert double quote(") by double quote - like
"F1","F2"
"this is ""BarTender"" you can take double quotes"," 001"
Another thought is find another character you would never use, then substitute space by that character(or character sequence).
In data source transform's search and replace, replace the character with space.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare