Topic on Manual talk:ImportTextFiles.php

200.159.15.248 (talkcontribs)

Hi there.

I managed to setup a documentation wiki for my workteam and I'm making an automation script to export mainframe procedures as text and import them on wiki as pages.

The problem here is that I have a text file with line breaks that the ImportTextFiles is not respecting at all.

They import as plain text which breaks the entire proc format.

This:

<code>

//CRMP301D JOB (CRM),'INTERFACE-CRM',MSGLEVEL=(1,1),REGION=6M,

//        MSGCLASS=X,TIME=999,LINES=999,CLASS=P

//*

//* %%SET %%DAT  = %%ODAY.%%OMONTH.%%OYEAR

//* %%SET %%H    = %%TIME

//*

</code>

Becomes this:

<code>

//CRMP301D JOB (CRM),'INTERFACE-CRM',MSGLEVEL=(1,1),REGION=6M, // MSGCLASS=X,TIME=999,LINES=999,CLASS=P //* //* %%SET %%DAT = %%ODAY.%%OMONTH.%%OYEAR //* %%SET %%H = %%TIME //*

</code>

200.159.15.249 (talkcontribs)

I made a workaround in shell:

4 #!/bin/bash

5 DIR=/home/ubuntu/txt_import/*

6 LANGUAGE=ptb ; export LANGUAGE

7 NLS_LANG="BRAZILIAN PORTUGUESE_BRAZIL.WE8MSWIN1252"; export NLS_LANG

8 LANG=pt_BR.UTF-8; export LANG

9 MWOS=linux; export MWOS

10

11

12 for FILE in $DIR

13 do

14 F=$(basename $FILE)

15     sed -i 's/\r/<br>/g' $FILE

This does what I want.

This, that and the other (talkcontribs)

The importTextFiles.php script treats the content of the text files as wikitext. If you want them interpreted as plain text, simply prefix each file with <pre> on its own line (no need for a closing tag). That way, line breaks will be preserved.

Reply to "CRLF being ignored"