A query to "Regex Gurus"

Good morning to all,

I hope this is the right place where posting this query, even if it is not strictly tied to SDL TS processing, but an operation sometimes needed to create a bilingual Excel file to import in SDL Studio 2015.

Suppose to have a plain text file like this one (Notepad++ 6.8.6) with the English (source) string on one line and the Italian (target) string in the subsequent line (this latter, sometimes, is a blank segment):

and that I'd need a result like this (a [TAB] instead a [CR][LF]) at the end of English [source] string followed by the Italian [target] string) to import and process it in SDL Studio 2015 using the "Bilingual Excel" file filter:

which I obtained creating a repetitive macro in Notepad++.

Now my query is quite simple, as I was not able to imagine it:

  • Can anyone suggest a "Find and replace" Regex function (provided it is possible) to transform the [CR][LF] at the end of the English (source) string to a [TAB], leaving untouched the [CR][LF] at the end of the Italian (target) segment in the whole document?

This will allow me to generate a *.csv (*.txt) file to import in a MS Excel sheet with, say, source text in column "A" and target text in column "B" to process it in SDL Studio using the "Bilingual Excel" file filter as follows:

Thank you for any advice/suggestion you might propose.

Claudio

Parents Reply
  • Hi Paul,

    thank you for your replies/comments.

    Probably I was not completely clear :-( , sorry for that.

    In fact, I can use the result of the second image containing the [TAB] character between English (source) and Italian (target) segments, but I was looking for a possible "Find and replace" Regex selective function to replace in the whole document (in Notepad++) the [CR][LF] with a [TAB] character just on lines 1, 3, 5, 7, 9, 11 of the first image, leaving untouched the [CR][LF] final character on lines 2, 4, 6, 8, 10, 12 in the same image, to obtain the same result I got in the second image applying a Notepad++ macro.

    Then, I suppose this is not possible.

    Thank you, anyway.

    Regards,

    Claudio
Children