Best way to save XML results to a file via command line

I'm trying to set up an easy way that I can save my XML results to a file via the command prompt.
Here's my current command line statement
sqlcmd -S server/database -E -i C:\XML.sql -o C:\Test.xml -h -1 -m 1 -y0
That works about 95% of the way. The problem is it still inserts a couple random line breaks and throws my whole XML off.
The whole idea of doing this via the command line is because it would be nice to link it to a batch file that runs every so often. Is there a better way to execute a SQL statement and have its contents saved properly to an XML file?

If I copy and paste the result via SSMS into a file and save it as an XML, I can view it properly in browsers. If I use the code above, I get among other errors: 
This page contains the following errors:
error on line 2 at column 202: Encoding error
The XML file gets processed in a 3rd party app. The file that I paste directly works fine, but the file that the script produces generates errors and it won't work.

Similar Messages

  • How to specify xml file to populate form fields in the PDF file via command line?

    Hi,
    I would like to specify xml data file to populate my pdf file using command line.
    The form was Reader extended.
    I've tried the following syntax :
    Acrobat.exe /A "zoom=100" "C:\example.pdf"#xml="C:\example.xml" but got an acrobat error: "the file name, directory name or volume label syntax is incorrect".
    Where am I wrong?
    Thanks!

    >If I understand correctly you propose something like this
    Something like, yes.
    >
    >Acrobat.exe /A "zoom=100" "xml=C:\example.xml" ....
    Certainly, neither will work. /A is followed by a single quoted
    string. There must be some separator, but I don't know what it needs
    to be (as I was alluding to in my first reply).
    To see if there is any hope, just try without the zoom= completely. In
    any case you can set the zoom in the document properties.
    Aandi Inston

  • I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show a

    I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show and put it where the Mac sharing can find it? So far, I made on one folder in Lightroom, put some photos there and I found them easily. Can this be done with a slide show? Please help quickly! Also worried that the photos I put on the new folder are hard to find afterwards, when the show is done. Where do they go when I delete from from the new folder?I am not alone

    Not that I'm aware of. You just export JPEG copies to a folder that you can point iTunes to. For instance, I have created a folder in my Pictures folder called Apple TV. And within that folder I have other folders of pictures that I can choose from in iTunes to share with Apple TV. But there doesn't seem to be any way to share a Lightroom slideshow. If you have laid to create a video file that would probably work. Apple TV is a little clunky in my opinion. Some things are a little more difficult to do now than they were a while back. I probably haven't provided you with much help, but just keep experimenting and I think you will figure it out.

  • How is the best way to save photos on vacation?

    While traveling I will use my iPhone 6 as my main camera.  What is the best way to save my photos & videos before I return home?
    Do I need to use Google+, Mylio, dropbox, Evernote or will all remain in iCloud?  I"m not sure how this works.

    One option is iCloud Photo Library:
    https://www.apple.com/icloud/photos/
    iCloud Photo Library beta FAQ - Apple Support

  • What is the best way to save an ai file so it can be opened in corel draw

    I have an ai file that needs to be opened in corel draw by a client. It needs to remain editable all paths and colors ect.
    Whats the best way to save it so it can be.
    yes I know corel is not as good as Illustrator but its what they have.

    Moving files back and forth between Adobe Illustrator and CorelDRAW is tricky. There's quite a bit more to it than knowing what version of CorelDRAW the client is using. If the artwork is fairly simple then there shouldn't be any problem with transferring the artwork into CorelDRAW. If the artwork has gradients, transparency effects, a lot of clipping masks, etc. then it's going to be a lot more dicey getting it to import into CorelDRAW properly. In addition to the .AI file you provide, you should give the client a PDF they can view in Adobe Reader or Acrobat so they can proof how the artwork is really supposed to look.
    I use Adobe Illustrator CC and CorelDRAW X6 in my work. I've used both applications for over 20 years. I don't consider either application better than the other. They both have their own unique strengths and weaknesses. I'll do a good bit of creative work within CorelDRAW to use certain features Illustrator either lacks or just doesn't do as well. Or I may need to design a really big project at full scale and Corel has a much bigger art board than Illustrator. Most of the time I move a lot of the stuff I created in CorelDRAW over to Illustrator for further refinement or moving it into Photoshop as paths or smart objects or just getting it ready to print (I don't like Corel's color engine even though it has improved in recent years).
    Like others have said, you need to know the basics of what the user has -mainly which version of CorelDRAW. The newer versions like the one I'm using can open Illustrator CS5 files. For older versions, you may have to save down to CS2 or even really old versions like Illustrator 8.
    CorelDRAW will not support certain Illustrator-dependent effects. For instance, if you apply a gradient to an object outline it will be lost when opened in CorelDRAW. A lot of other effects won't be maintained when opened in Corel unless they are flattened/expanded. Some effects may even have to be rasterized, and that can create other issues. Out of effects that are maintained, some may have to be adjusted. CorelDRAW and Adobe Illustrator handle things like gradient fills differently and don't understand how to portray gradients from their rival application accurately. Some nice fill that was created in CorelDRAW may have to be tweaked or completely rebuilt when opened in Illustrator.
    I get a lot of customer files in CorelDRAW and also a lot in Illustrator. That reason alone makes it necessary for me to have both CorelDRAW and Adobe Illustrator running on my computer.

  • What's the best way to save an 8.5 x 11 image for use as a page background in a PDF?

    What's the best way to save an 8.5 x 11 image for use as a page background in a PDF? My goal is to have a relatively small final .pdf file size that includes numerous pages with full 8.5 x 11 images as backgrounds in the document. If I save at 8.5 x 11 and 72dpi (example), the image is not 8.5 x 11, and the quality is not good enough. I need help with size, dpi, and file format to save as before I place it in InDesign and then save as a .pdf.
    Thanks,
    Jim

    Do exactly what I said then.  Create the InDesign document of the required dimension, and chose whether it will be high quality print, or Interactive PDF.  It really doesn't mater what format you bring the image into that document.  It can be JPG, PNG, but I usually use native Photoshop PSD.  The image does have to be of high enough resolution, but it can be many times bigger than iis required for the final export.  (InDesign does not import the image, but rather references it on your hard drive.)
    When you have placed your text and finished your page, then export it to PDF, but go through the tabs chosing suitable settings.  If the image needs to be downsized, InDesign will do that at this stage while building the PDF.
    If you can tell us how this presentation will be made (Projector, overhead projector, printed page etc. or just emailed to the end users) we can help you more with the final output settings. 

  • What the best way to create XML files from JAVA application?

    Hi to all,
    I need to edit and to create new filex in format of xml. I know to parse, but what would be the best way to do:
    1. - Create new file, create like simle text file, or there is some clases that know to do it in more simple way
    2.a - Edit XML file, to take some data and add it to the XML in the place I want to.
    2.b - Also Edit, but not to add fields, just update some of them.
    Code examples or links to samples woul be welcomed.
    Best regards, Nick.

    I have tried working with XML directly using the Java classes but this was a pain. I then looked at DOM4J and JDOM and found JDOM easier to use.

  • Whats the best way to save large folders/files on multiple dvds?

    hi,
    A quick question about the best way to save to dvd(4.7gb disc) a large number of folders/files.I've got about 30-40gb of stuff to save from mp3 sample files through to logic audio files.I already have them saved to another HD but i just want to be extra safe and have another back up.In the past i've just saved it disc by disc creating each folder as i go dragging the appropriate folder across.I was just wondering whether there was an easier way than this.May be an application where i can drag all the files and it will sort and save everything for me much like the way itunes now saves/backups files.
    thanks
    darren

    Hi darrenz,
    if you have Toast you can save your stuff using Toast. There's a great option within Toast. You need to select the Data tab and choose "Mac only". Then just drag all the stuff you want to burn to the Toast window and it will automatically ask for another DVD until everything is burnt. After that all your DVDs will have a Toast Restore app on them. It lets you select what you want to restore and will tell you which DVDs to insert. Here's a screenshot I found by googling: http://www.macworld.com/images/content/2005/08/19/toast7restore.jpg
    Have fun!
    Björn

  • Best way to save iMovie Projects

    I am using iMovieHD and have about 50 hours of video to import and then to save. I recently bought a LaCie 250G hard drive. I do not know the best way to save these movies which I have imported and edited but since they are in effect out family treasury I would like a good quality. I can al;ways make new iDVDs from the edited iMovie so assume I will not need to save the iDVD projects. Any recommendations?

    I think Apple should post some BIG ads to make some things clear
    Hi Hunting,
    "Quciktime" is not a format nor a compression method; QT is "just" a socalled container or warpper, containing many media formats (the .mov suffix is irritating people...), have a look here for an overview how many formats 6 codecs are a "Quicktime" file...
    ... mpeg4 is just one of them...
    to answer your question:
    that depends MUCH on, what you want to do later with your stored movies:
    * dv is highest possible quality with iM files - but: 1h = ~12Gb !!
    * mpeg4 my personal favorite, good pic quality, small file size BUT! as any mpeg-"flavor", it is a lossy compression codec...- in case, you plan to make in two years a nice dvd, that lossy mpeg4 has to be converted into mpeg2 (another lossys format) ...
    there are some dvd-standalone player on the market, able to playback ISO-conform mpeg4 files (not in a .mov container, but as .mp4....)
    * in case, you want re-edit, you need to store the iM-projects...
    * the new h.264 is a fanstatstic codec, but too new, as: you need fast Macs for playback and warp-fast Mac for encoding...
    summary/recommendation:
    hd drives prices drop; I would store in .dv, three times bigger as a dvd (tento 20 times bigger then a mpeg4...) but best format for "post processing" (edits, dvd burns, website compression, switching to mpeg4, h.264....)
    to add some silly ToolTime idea (call me Tim, I'm using it, short in money):
    just for storage, you can buy 3,4,5 drives plus ONE empty fw-case; it is very easy to build a drive inside such case (two multi-pin cables); transfer files; build second hd into case... you just store the hds... looks silly, but works important: write onto some paper, what's on that drives...

  • Best Way to Save Data

    Hi all, I'm relatively new to Java, and have a quick question.
    What is the best way to save data in an application, and what is a good rule of thumb when to dive into a database to hold the information. For example a directory of people and their information. I want the program to be able to add/update/delete the information with ease.
    I was reading in Core Java Vol II how to save object data to a file, but it seems tedious if I have to run through a list of objects and save each one. I just want to be able to save records, and retrieve them to edit later.
    Thanks in advance,
    \\//

    UnknownSector wrote:
    Hi all, I'm relatively new to Java, and have a quick question.Hy there, when you find some time, go read [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html], it will help you in the future.
    What is the best way to save data in an applicationThere is almost never a "best way" to do anything. At least not if you don't define your requirements exactly. It depends on tons of things, that's why there are so many ways to "save data".
    Writing to files and saving to databases are just two of those, and even among those, there are thousand of different ways to handle it.
    , and what is a good rule of thumb when to dive into a database to hold the information.When the data is structured and you want to do queries on it, then you can probably look into a database. When the data is structured and you've got lots of it, then you really should look into databases.
    For example a directory of people and their information. I want the program to be able to add/update/delete the information with ease.Too little information, but I'd tend to go with a database. But then again, I'm going for a DB rather quickly.
    I was reading in Core Java Vol II how to save object data to a file, but it seems tedious if I have to run through a list of objects and save each one.I don't know what exactly you're talking about. Are you talking about serialization? What makes you feel that it is tedious? Can you describe it?
    I just want to be able to save records, and retrieve them to edit later.Well, that can be done in many, many ways. That alone doesn't force you to go one way or another. It's pretty much the definition of "save data".

  • I have elements 6.  What is best way to save a slide show to a CD/DVD with the best quality?

    I have Photoshop Elements 6.   What is the best way to save a slideshow to send by email or on CD/DVD and still get the best quality.
    I save as a project and then email and when you open and play the slideshow the pictures are not clear.

    IiTunes unless you have bought extra Icloud space for the photos. 

  • Best way to save illustrator files to place in Indesign

    Hello,
    I have played with many options. but can someone tell me the best way to save an illustrator file, so I can place it InDesign and it will print faster yet still hold true to quality and color?
    Is it .ai, eps, pdf, tiff, or .png ..I didn't like .gif, or jpeg.....
    The place time and print time is brutal in InDesign and when I a create PDF file the redraw in acrobat is terrible, if they were placed .ai files.
    So just looking for the best case scenario to have faster printing and placing in InDesign and no redraw in PDF files.
    Just looking for some guidance and advise.
    thanks!
    babs

    iBabs2 wrote:
    Hello,
    What exactly is that flattening doing? I see it puts everything in one layer...is that all it does?
    When I place them in InDesign, the performance is about the same and when I make the PDF, they still rebuild there.
    Are there any options for flattening, or just the flatten from the layers menu?
    maybe I am missing something.
    thanks!!
    babs
    Flattening is not just a reference to layers, it is a reference to transparency effects (opacities, soft masks such as drop shadows, and blend modes). Flattening makes a mess of the file. If you don't have to flatten, don't.
    If you do have to flatten, do it from InDesign. This means placing the native Illustrator file saved with PDF compatibility (default behavior)
    Again, never flatten unless you have to, and save it for last. If you don't need to flatten, output from InDesign using PDF/X-4. When you preserve transparency, output time is sped up considerably, and you don't end up with stitching artifacts (white lines) in the PDF.

  • Best way to save and view raw files while traveling.  I have dropbox but new ipad user and not sure of best way.

    What is the best way to save photos when shooting RAW while traveling.  Would like to save raw files but also view and email from iPad.  I also have dropbox.  Will be in Europe next spring.

    Unfortunately, the playback of non-iOS-native video formats (everything except mov / mp4 / m4v) is horrible through Apple TV and it, because of the inherent speed restrictions of Wi-Fi, can't be helped other than:
    - pre-converting your video files to mov / mp4 / m4v before playing them. (THis is the best solution.) For this, you will want to use the absolutely best and fastest video converter, the free(!!!) HandBrake. Don't ever think of paying any money for any video converter - most other titles are way inferior to HandBrake. (See http://www.iphonelife.com/blog/87/benchmark-excellent-multimedia-converter-handb rake-vs-commercial-apps for more info on this q.)
    - using a VGA or HDMI adapter and connecting your TV directly to the iPad.
    In the thread at https://discussions.apple.com/message/18697551?ac_cid=sa123456#18697551 , we've also discussed this problem (AirPlay vs. cabled playback)

  • Best way to save entire program seperately in LV8?

    Greetings.
    What is the best way to save the entire application that I am writing so that I can go back a version if I make too many mistakes in Labview 8?  Note that I use FPGA vi's which complicate matters.
    To clarify, I am writing quite a large program, it has 900+ vi's and also many type definitions, even an FPGA program and vi's for some other hardware... various libraries, ect.  I would like to be able to save the entire program including everything to... let's say version 1, and then make changes, save to version 2, then I would like to be able to go back to this working version 1.   The problem I am currently having is that if I edit a type definition or anything other than the main vi in Version 2, then the version 1 of my program ceases to work as tt tries to use this same type def I just altered.  If instead i do a build to a new directory for each version, the program tries to make me re-compile my FPGA program. What is the best way to handle saving different versions in Labview 8 so that they are complete and seperate but so that I can still edit them and so that they still access my FPGA vi without having to re-compile it?  Note that my FPGA vi is already working so I'm not changing it with different versions of the program.
    Thanks very much.
    Richard Cisek
    [email protected]

    Create a "source distribution" of your project. (under "Build Specification" in the project explorer)
    LabVIEW Champion . Do more with less code and in less time .

  • Best way to save high definition video

    I recently purchased a Canon HD camcorder and hope to burn the video onto Blu Ray discs in the future. Until I get a burner, what is the best way to save the video files to preserve the 1080 HD?

    Just keep your projects and events. You can share the projects in multiple formats. Later, you can go back and share the movie as a quicktime movie that can be burned using toast. You can do this today without a bluray burner. Also, look into a little device called Western Digital Media Player. You can use this with a USB hard drive and just export your movie as HD.

Maybe you are looking for

  • When i connect my iphone to the computer, win 7 i get the mtp driver error  (Code 31).

    When i connect my iphone to the computer, win 7 i get the mtp driver error  (Code 31). I must mention that connecting the phone and accesing it as a camera worked before but at some point it didn't and i keep recieving this mtp driver error. I tried

  • SQL environment variable into a local variable in stored procedure ?

    How do i set a SQL environment variable in a session ? How can i read an SQL environment variable into a local variable declared in my stored procedure ? Does any exceptions occur in the process ? I need this very urgently, can anyone help ? thanks s

  • HREAP VLAN Mapping

    /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-

  • Good chroma keying app for ipod 4g?

           Does anyone know of a good app for chroma keying (or green screening) on the ipod touch 4g? I have seen like ten or so, but was wondering if anyone here has used one that they really like?        Also if anyone knows of a good video editing ap

  • I have a question about multiple users with Photoshop CC/Lightroom CC.

    With a single subscription to the Photography bundle of Photoshop and Lightroom CC - how many simultaneous users are permitted? For example, if I have Photoshop running on my desktop, can someone else use the version that is installed on my laptop?