Importing XML Text files with Indesign friendly 'Carriage Returns'

Hi,
I have a question wrt importing XML into Indesign.  I have my text stored in Excel (Fig A) and intend to export as an XML file where each line will represent each page.  However, my first attempt failed to treat the 'carriage returns' as I'd envisaged:
The 'carriage returns' used within an Excel cell (ALT-ENTER) are maintained when transforming to a CSV file (Fig B).  However, when converting to an XML file, the conversion only takes place on a line by line basis and hence the XML file becomes incomplete (Fig C).
So, it appears I need to make sure that the CSV file contains one line per entry, while also maintaining the actual carriage returns in my source spreadsheet and for Indesign to recognise them.  In order to do this, I'll need to substitute the 'carriage returns' in my excel column to be represented by a new set of characters.  My question is how can I let Indesign know to recognise this set of characters to be converted to a carriage return, when importing text.
For example, if this set of characters was '%%%%%%', then my new csv file would look like Figure D and the XML would be produced correctly, like Figure E.  Then importing this XML file to InDesign, the carriage returns would automatically be reinstated, hopefully.
I hope someone can help me as I am only starting out in Indesign and feel Im running before I can walk by venturing into the XML/Indesign arena too soon.
Best Regards
Luke

Hi,
Thanks for all the responses.
With regard to XML, it could well be an issue has crept in because I am using another utility to convert my csv's to xml and maybe there are better options out there. I will take a look for other utilities and try that (Its not possible from Excel easily, even though there is an option to save as an XML file).
Secondly, because the XML was readable by internet explorer, I assumed it had a satisfactory standard XML format which would be accepted by any program, including InDesign.  This proved true, since the XML file i generated was actually recognised by my Indesign document and populated the tags correctly, albeit without any carriage returns. 
When I save my excel sheet as a csv, it does actually hold the carriage returns causing multiple lines per entry, hence why I need to substitute the actual carriage returns in my excel sheet to a alternative character set so that the entry remains on one line.
Re: Double quotes on text fields.  Im sorry, I didnt realise I had commas in my sample csv example.
I should have corrected it, but I intend on using semi-colons as my csv delimiter and don't intend on having semi-colons in my excel sheet itself, so I possibly won't need any double-quotes.
So, it looks like this is what I need to do ;
i)   Add a column in Excel which substitutes all the carriage returns with a line break identifier (^n).
ii)  Convert Excel file to a semi-colon csv holding this new column,
iii) Convert csv file to XML using a good CSV->XML utility,
iv)  Add the respective XML tags to my INDD document,
v)   Add a GREP rule which does a find/replace on all instances of ^n and replace with a line break,
vi)  Import the XML file,
vii) Apply the find/replace GREP rule on the whole document. Carriage returns on my text fields should be consistent with my original excel sheet.
Thanks for all your help fellas.  Will report on how I get on once Im done.
Best Regards
L

Similar Messages

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • Importing WORD text files with formatting and Text Flow issues IDCS3

    I am a designer who has used ID since it first came out, but have not been utilizing the larger document capabilities lately as I've been working in large format graphics (like really large, so if you have questions on that I can answer!). I am working on a new magazine and the copy is in WORD. I want to know the best way to bring in the text and keep the italic and bold formatting. The WORD docs have no style format done by the writers, so therefore changing the styles to my styles in the custom import section doesn't work. I tried making a character style sheet with no font chosen just "italics", but didn't work. I still was unable to make a paragraph style on top of it.
    If anyone has a good methodology for bringing in WORD text and keeping it's attributes while applying ID style sheets please help!
    Also with text flow, I have always had an issue with ID with not creating more pages to keep the flow going. In a test I just did I placed the text, but it did not create any new pages. I know there's a way to make that work, but spell it out for me like I'm a person losing their mind which seems to be the case!
    Thank you in advance to the person who can give me advice!

    What for settings do you have on the importoptions when bringing in Word? Keep formatting or loose formatting? And if loose formatting: is Keep local formatting on or off?

  • Importing text file (with file names) into Automator.. is it possible?

    Hello all,
    I have been working with Windows Batch files for my line of work. I have a couple of file names in a text file (a column), which I want to copy from one folder of one hdd to another folder on a different hdd. I have been trying to do this kind of work with a Mac. I already know how you copy and rename files in automator (which isn't difficult, of course) but you have to 'select' the files in the finder first (with get specified items).
    But the only way i see that you can specify items is by selecting them... is there a way to import a text file with all the file names instead of selecting all the file names manually?
    or is there an AppleScript alternative which I can use to import the text file (or just copy into applescript) and run before the query's of copying and renaming the files? I am kind of new to Apple programming.
    The text file looks like this:
    image1.jpg
    image2.jpg
    etc..
    so there has to be a command to: 'goto' a specific folder as well.
    Thanks in advance!

    You can import text files, but if they are just names you will need an additional action to add the source folder path. A *Run AppleScript* action can be used, for example:
    Tested workflow:
    1) *Ask for Finder Items* {Type: files } -- choose the text file containing the names
    2) *Combine Text Files* -- this gets the text file contents
    3) *Filter Paragraphs* { return paragraphs that are not empty } -- skip blank lines
    4) *Run AppleScript* -- copy and paste the following script:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 680; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters} -- add folder path
    add the specified folder path to a list of file names
    input: a list of text items (the file names)
    output: a list of file paths (aliases)
    set output to {}
    set SkippedItems to {} -- this will be a list of skipped items (errors)
    set SourceFolder to (choose folder with prompt "Choose the folder containing the file names") as text -- this is the folder containing the names
    repeat with AnItem in the input -- step through each name in the input
    try
    set AnItem to SourceFolder & AnItem -- add the prefix
    set the end of the output to (AnItem as alias) -- test
    on error number ErrorNumber -- oops
    set ErrorNumber to ("  (" & ErrorNumber as text) & ")" -- add the specific error number
    set the end of SkippedItems to (AnItem as text) & ErrorNumber
    end try
    end repeat
    ShowSkippedAlert for SkippedItems
    return the output -- pass the result(s) to the next action
    end run
    to ShowSkippedAlert for SkippedItems
    show an alert dialog for any items skipped, with the option to cancel the workflow
    parameters - SkippedItems [list]: the items skipped
    returns nothing
    if SkippedItems is not {} then
    set {AlertText, TheCount} to {"Error with AppleScript action", count SkippedItems}
    if TheCount is greater than 1 then
    set theMessage to (TheCount as text) & space & " items were skipped:"
    else
    set theMessage to "1 " & " item was skipped:"
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
    if button returned of (display alert AlertText message (theMessage & return & SkippedItems) ¬
    alternate button "Cancel" default button "OK") is "Cancel" then error number -128
    end if
    return
    end ShowSkippedAlert
    </pre>
    5) *Copy Finder Items* { To: _your external drive_ }

  • Problem importing text file with null value

    I used the following codes to import a text file and it
    worked perfectly.
    However, it skipped the TAB (chr(9)) on the imported row when
    there is no data (empty string) in one of the columns.
    Can someone help? thanks!
    sample text file data:
    00001 desc1 12.00
    00002 25.00
    00003 desc2 15.00
    Code that I used:
    <cffile action="read" file="#FilePath#"
    variable="data">
    <cfset newLine = chr(13) & chr(10)>
    <cfset tabChar = chr(9)>
    <cfoutput>
    <cfloop list="#data#" index="row"
    delimiters="#newLine#">
    <cfset cols = listToArray(row, tabChar)>
    ID = #cols[1]#
    desc = #cols[2]#
    price = #cols[3]# <br>
    </cfloop>
    </cfoutput>

    There is no perfect way to handle this with out you writing
    more complicated code.
    A good compromise is to replace this line:
    <cfset cols = listToArray(row, tabChar)>
    with this:
    <cfset cols = listToArray (Replace (row, tabChar &
    tabChar, tabChar & "{empty}" & tabChar, "ALL"),
    tabChar)>

  • Importing text file with variable spaces

    Hi all
    I have a text file with a varying amount of spaces in it. Typical output from the file is attached.
    How can I separate the values into separate columns please?
    Thanks in advance.

    You're going to need some substrings:
    DECLARE @flatFileLine VARCHAR(MAX) = '2002 01118511 0.00 0 0.00 0.00 PENDING '
    SELECT
    SUBSTRING(@flatFileLine,1,4),SUBSTRING(@flatFileLine,5,17),SUBSTRING(@flatFileLine,22,17),SUBSTRING(@flatFileLine,39,17),SUBSTRING(@flatFileLine,56,17),SUBSTRING(@flatFileLine,73,17),SUBSTRING(@flatFileLine,90,17)

  • How to import a PSD file into Indesign WITH layers so it can be edited/saved as an InDesign file?

    How to import a Photoshop file into Indesign CS6 so that it's layers show in InDesign and it can then be edited/saved as an InDesign file?

    MyTienN wrote:
    Someone had mentioned the possibility of saving each individual layer in Photoshop as a png file and importing into Indesign and adjusting it in there
    What do you mean by "adjust"? Editing of Photoshop images should be done in Photoshop.
    Sure, it's possible to save individual layers from an image in Photoshop as inidvidual files in a variety of formats, but what's the point? You could just as easily import the layered file, then copy/paste it into a new layer for each layer in the image and use layer visibility to control which ones show. I don't think that will do you a lot of good, though, if you use adjustment layers or opacity controls on the layer in Photoshop.

  • About the exporting and importing xml data file in the pdf form

    Hi all,
    I need help for importing xml data file in the pdf form. When I write some thing in the text field with fill color and typeface (font) and exported xml data using email button. When I imported that xml file in the same pdf file that is used for exporting the xml data then all the data are shown in the control but not color and font typeface. Anyone has suggestion for solving this problem. Please help me for solving this problem.
    Thank you
    Saroj Neupane

    Can you post a sample form and data to [email protected] and I will have a look.

  • What happened to importing plain text files in iTunes?

    I used to be able to export the playlist containing all the music I wanted to listen to as a plain text file. I would then import this file into a spread sheet, sort as I desired, assign each song a number, sort on that number and save the resulting groups to plain text files. I would then import these text files as playlists. It appears that this capability has disappeared in the current version of iTunes. I am capable of working with the xml if I have to, but that is more effort than I think is necessary. Have I missed something?

    I have been thinking about what you are suggesting and even with your last reply it does not solve the problem. I suspect you still do not see what I am driving towards. I have playlists for all songs with 5 starts, all songs with 4 stars, all songs with number of plays less than n. I also have playlists of those three that have not been played in n days. I listen to those sometimes. I also listen to my existing playlists which contain subsets all music not christmas and have at least a 3 start rating. This last set is not smart at present. With the current setup, music in those first 3 playlists get played more often. Any smart playlist that has to include not played in the last x will not play those songs more often unless I play those playlists more often. At present, to generate those non smart playlists I export, divide, and import information. Apple has changed the format it accepts on input. I either have to accept their new import method and start programming, or find a smart playlist method that solves this problem. I do not believe that anything yet suggested for smart solves the problem. The closest I have come is 3 playlists. One smart and two dumb. The smart one is all songs with rating above 3 and not christmas that have not been played in last x and is not in the two dumb ones and limit to 100. The dumb ones start empty. Let it populate, drag the list to one of the dumb ones. Let the smart one recompute. Drag it to the second dumb one. Play one list on each device. When playlist finishes, blank the dumb one for that device, sync, let iTunes repopulate the smart list, drag to dumb list and sync again. In the long term, I think I am better off programming.

  • My Fonts change when opening an InDesign CS4 file with InDesign CS6

    I've been experiencing strange behaviour when opening a InDesign CS4 file file with InDesign CS6: the kerning and spacing is all off:
    Original file:
    opened in InDesign CS6:
    Is this a conversion error? Is there a setting/pref I've got wrong?

    It's more than a year ago since this issue was reported, but at this time I'd had the same problem when opening a CS4 document in CS6/CC.
    I was amazed that a header, placed in capitals, looked different in CS6/CC. But at last, after several tests, i've came to the conclusion that "forced" capitals behaving different than "real" capitals. In others words: when you forcing text to capitals the kerning would be different in CS6/CC. When you place text in real capitals (Shift + text) the kerning is the same as in both InDesign versions.
    Text in CS4:
    As you can see: in CS4 there's no difference between real capitals en forced capitals.
    Below the results when opening the CS4 file in CS6/CC:
    I'm not sure if there are still people struggling with this problem, but hopefully was is this helpful.    

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • How to import a text file created in Pages (iWork '08) to Photoshop Elements

    I am totally a novice at working with Photoshop Elements.  I need help.  I want to create my business card in Photoshop Elements with a background image and then a text layer over the background layer.  The logo and text was created in Pages (iWork '08).  Can I import this text file to Photoshop Elements and if so how do I do that?  I cannot create the same logo in Elements unless someone can tell me how to draw a circle with a transparent background so that just the outline of the circle shows and the background comes through.  Thanks for any help you can offer.  I have OS X Snow Leopard 10.6.4 and Photoshop Elements 6.

    In PSE, to draw an empty circle use the elliptical marquee tool and hold down shift while you drag to constrain it to a circle. That will give you an empty selection, then go to Edit>Stroke (outline) selection. A window appears where you can choose the width and color of the stroke.
    However, I'm not understanding why you would want to create your business card in PSE rather than in Pages or equivalent. Is there a special reason for this?
    EDIT As for the text file, it would be simpler just to retype it in PSE, since it can't be very much text. Remember that PSE doesn't do all the fancy things with text that Pages can, although it can do some things (like warping) that Pages can't.
    You could activate the text tool and use copy/paste, but you'll lose most of the formatting.

  • Problem in bulk import of text files in SQL Server

    Hi,
    I am using sql server 2012 x 64 and trying to import some text files (tab/ comma separated) and ms access files in sql server tempdb
    I am trying bulkinsert on text file but it is inserting all data in a single line in sql while in text file I have 1000K lines,
    Then I tried importing other data using openrowset from access file but I am getting following error
    Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".
    can any one please provide some assistance . If I am able to upload the data from flat text file then it will be enough as I am getting data in tsv or csv format
    Nitin

    If this is a one-off, I think you should try the import/export wizard in SQL Server Management Studio instead. This may be easier to get working.
    If you want to this import on a regular basis with BULK INSERT, we need to see the CREATE TABLE statement for your table and a sample file. Best if you can upload the file on Skydrive, Dropbox or similar, as the exact bytes matters.
    To connect to an Access database, you use the ACE provider. Never heard of MSDASC before.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Since last weekend (3-15-15) I have been unable to send/receive text messages with a friend who has Sprint service. The messages send with no errors on either side, but neither side is receiving the messages. Is anyone else having any similar issues?

    Since last weekend (3-15-15) I have been unable to send/receive text messages with a friend who has Sprint service. The messages send with no errors on either side, but neither side is receiving the messages. It seems to be only this one person affected by this issue, everyone else that I've tried sending messages to has responded with no trouble. Is anyone else having any similar issues?

    Retrohacker, Your text messages are too important to be missed! Let's figure this out, together. Are you able to successfully make and receive calls from your friend? Which phone do you have with us? Any new messaging applications or changes that you can recall on the phone since this issue began? Please share details so we can get to the bottom of this for you.  TanishaS1_VZW Follow us on Twitter @VZWSupport  If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Loading text file with flash lite 3.0 problem

    Hello,
    I recently ran into a problem with loading a plain text file with Flash Lite 3.0.
    I know there is a way to load name/value pairs using LoadVars class or XML file using XML class. Both methods work great, but these classes parse the data loaded and I need to load just a plain text - no pairs or xml structure. (its because Im loading specific file format, so I can't make any changes to it)
    There is a simple way how to achieve this in Flash using Actionscript 2 by extending the LoadVars class and overriding the onData() method. I used it plenty of times and it works fine.
    There is an example of implementation:
    // the PlainData.as file
    class PlainData extends LoadVars {
        function onData(str) {
            trace(str)
            this.onLoad(true);
    // now in the main file
    var my_data:PlainData = new PlainData();
    my_data.load("my3dmodel.obj");
    This code traces unchanged content of my3dmodel.obj file.
    The problem comes when I try to run this code using Flash Lite 3.0. The code stops working just by changing player version in publish settings to Flash Lite 3.0. It doesnt display any error, but also doesnt trace any content.
    Is there a reason why you cant override onData method in LoadVars class in lite version of flash or am I doing something wrong?
    (also overriding onLoad() method works fine in Flash Lite)
    Ondrej

    Thanks Man
    But i m very unhappy !!! :-(
    1M data to transfer my mp3 files is very small !!! hehehe
    Thanks a lot
    See ya
    Carlos Eduardo Burko - Curitiba - Brazil - Macromedia
    Certified Professional
    "biskero" <[email protected]> escreveu na
    mensagem
    news:e98nrb$a6e$[email protected]..
    > Ciao Carlos,
    >
    > yes you can load mp3. The only issue is that the FL2
    will need to load the
    > entire mp3 in memory which mean you are limited to the
    avalable memory and
    > also
    > there is a limitation of 1M data transfer.
    > Try to create a sample application to test it. You need
    to use the
    > loadSound
    > API.
    >
    > Alessandro
    >

Maybe you are looking for

  • Hiding  a Equipment  view  in a  transaction iq01

    Hai Friends,              How to hide a Equipment view in a transation for create material serial number (iq01). Regards, Sathis Kumar R

  • Please! I need someone help with a game

    I got this Error everytime the scene is reseted. I have no clue where mistake is made. Please help! TypeError: Error #1010: A term is undefined and has no properties.     at golfer_fla::MainTimeline/resetScene()     at golfer_fla::MainTimeline/golfer

  • Best practice to manage a SessionBean with JMX

    Hi, I have a SessionBean and a User specific MBean. The SessionBean holds a static boolean which should be controlled by the MBean. Now should the MBean tell the SessionBean when the state changes or should the SessionBean setup a ChangeNotificationL

  • Nokia E65 firmware update due in October

    Hi all, we just received a message from the Eseries team. They informed us that "Nokia will release a firmware update for the E65 in October for most E65 variants." There's been plenty of discussion here among E65 owners so I hope this helps. We do n

  • Copying data between Applications

    Hello all, Is there a recommended approach to copying data between applications within the same application set? I have a cube that's the mirror image of another cube, excluding the difference in dimension names. I want to pass data from one cube to