DMT line feeds

Anybody know how to get DMT to export/import line feed characters in comment fields? I see a few old threads on here but nothing definitive.

TIA,
Josh

Have a nice weekend

1 Like

When I was exporting data out of our legacy system, I used char(10) in excel formulas to produce the Line Feed. char(13) for Carriage Return didn’t seem to do anything.

image

Don’t forget to turn on “wrap text” in excel to see the effect.

NOW, I’ve seen Epicor acknowledge this as the /r/n successfully in the display, but you MAY run into issues in SSRS report and have to replace the char(10) with a different CRLF syntax.

1 Like

The last time I went through this process, I replaced all my line breaks with special character combos that are not used in the comments. Like or . After replacing, I exported the data, and reimported it. Then I had to replace the special character combos again with the proper line breaks.

You could write a function or a BPM to replace the line breaks. Or you could just do the replacements in a BAQ export.

I hope this helps! If you find a really solid solution share it with us all!

2 Likes

This is the way if you’re assembling things in formulas. If you’re typing things in, Alt-Enter inserts a linefeed instead of advancing to the next row. If you’re assembling a csv, save excel as csv and the csv will contain the necessary quoted structure for a multiline datum.

That one’s vbCrLf

3 Likes

Thanks for your replies. I understand how to do it in Excel but I’m not working in Excel.
Simply doing: DMT export csv > DMT Import csv via command line.

Would be nice if DMT handled command characters within fields more elegantly.

I’ll post back if I find a way.

If you’re not manipulating the data and just exporting and importing it… well I guess my question is what are you trying to do?

1 Like

Ok…I;m dum. :grimacing:
Turns out I must not’ve tried re-importing the untouched files because I tried just now and it works just fine. Apparently, I must’ve seen the new lines in my text editor and jumped ahead to ‘this is a problem’ without testing the output as-is.
Duh!

4 Likes

…now if only I can figure out how to get VSCode to display LF character instead of creating a new line so this underslept data wrangler doesn’t jump to unfounded conclusions and waste everyones time. :face_with_spiral_eyes:

Use Notepad++
:rofl:

1 Like

RIGHT!? this is literally the last remaining reason I’ve had NP++ on my systems for the past several years (checks 4 systems and it’s not installed) eh maybe more like a decade(?) must…resist…download! :persevere:

regex search is an option
image

Also a very good option! Not entirely fair to MS though, discerning document LF and CR from LF and CR added by display linewrap is a truly hard problem. It’s not as if a solo developer working for handouts could have solved that 20 years ago and published the solution in clear text on github. (darn you, GPL3!)

Anyway, LF is enough in an import CSV file. I’ve done bunches without bothering with CR and DMT hasn’t complained as long as the multiline field is quote constrained like so:

field1,field2,field3
foo,"bar
baz",quz
2 Likes

FWIW, looks like there are extensions to ‘display’ eol characters in VSCode, BUT…

VSCode normalizes eol characters upon read, and there’s no opt-out, so any such ‘display-eol’ extensions are useless as LF & CRLF are all normalized to CRLF upon open.
Provide option to opt out of line ending normalisation for files ¡ Issue #127 ¡ microsoft/vscode ¡ GitHub
Not likely to change this behavior any time soon.
[downloads NP++]

1 Like