Skip to main content

Search

Search

Trimmed Field

Comments

3 comments

  • Avatar
    Shotaro Ito

    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
  • Avatar
    Legacy Poster

    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
  • Avatar
    Shotaro Ito

    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

Please sign in to leave a comment.