Turning Upload script into multiple upload script

Hi all,
I would like to change the following script so it is able to handle 2 file uploads. With a basic understanding of PHP, this is a bit beyond me and you may laugh and the initial attempt (found at the the bottom of the post).
Here is the original script for one upload:
<?php
//this is the directory where the images images will be saved
$target = "../IMAGES/books/";
$target = $target . basename( $_FILES['imageURL']['name']);
// this gets all the other info from the form
$name=$_POST['name'];
$publication=$_POST['publication'];
$year=$_POST['year'];
$desc=$_POST['description'];
$link=$_POST['linkToBuy'];
$price=$_POST['price'];
$pic=($_FILES['imageURL']['name']);
// Connects to your Database
mysql_connect("localhost:8889", "root", "root") or die(mysql_error()) ;
mysql_select_db("keithMcCarthy") or die(mysql_error()) ;
//Writes the information to the database
mysql_query("INSERT INTO books (name,publication,year,description,linkToBuy,price,imageURL)
VALUES ('$name', '$publication', '$year', '$desc', '$link', '$price', '$pic')") ;
//Writes the photo to the server
if(move_uploaded_file($_FILES['imageURL']['tmp_name'], $target))
          $note['success'] = 'The file '. basename( $_FILES['imageURL']['name']). ' has been uploaded, and your information has been added to the directory';
else {
          //Give an error if it's not
          $note['error'] = 'Sorry, there was a problem uploading your file.';
?>
Here is my attempt - it sends everything to the database but does not upload the file and gives an error "Sorry, there was a problem uploading your file." At leat that is working.
<?php
//this is the directory where the images images will be saved
$target = "../IMAGES/books/";
$targetTwo = "../IMAGES/books/";
$target = $target . basename( $_FILES['imageURL']['name']);
$targetTwo = $target . basename( $_FILES['imageURLtwo']['name']);
// this gets all the other info from the form
$name=$_POST['name'];
$publication=$_POST['publication'];
$year=$_POST['year'];
$desc=$_POST['description'];
$link=$_POST['linkToBuy'];
$price=$_POST['price'];
$pic=($_FILES['imageURL']['name']);
$picTwo=($_FILES['imageURLtwo']['nameTwo']);
// Connects to your Database
mysql_connect("localhost:8889", "root", "root") or die(mysql_error()) ;
mysql_select_db("keithMcCarthy") or die(mysql_error()) ;
//Writes the information to the database
mysql_query("INSERT INTO books (name,publication,year,description,linkToBuy,price,imageURL,imageURLtwo)
VALUES ('$name', '$publication', '$year', '$desc', '$link', '$price', '$pic', '$picTwo')") ;
//Writes the photo to the server
if(move_uploaded_file($_FILES['imageURL']['tmp_name'], $target))
  $note['success'] = 'The file '. basename( $_FILES['imageURL']['name']). ' has been uploaded, and your information has been added to the directory';
else {
  //Give an error if it's not
  $note['error'] = 'Sorry, there was a problem uploading your file.';
if(move_uploaded_file($_FILES['imageURLTwo']['tmp_name'], $targetTwo))
  $note['success'] = 'The file '. basename( $_FILES['imageURLTwo']['name']). ' has been uploaded, and your information has been added to the directory';
else {
  //Give an error if it's not
  $note['error'] = 'Sorry, there was a problem uploading your file.';
?>

Thank you for your help, trulfy!
However, I am so new to all this that I don't really even understand your reply or how to do it...
Maybe you could put it in more simplistic terms/steps?
Thank you anyway!

Similar Messages

  • How do I turn psd files into multiple size pngs?

    I have over 2,000 different size psd files, both portrait and landscape, that need to be formatted in 3 main ways.
    I am looking for some automator or photoshop actions way to do this to save hours and hours and hours of work.
    The first step is that each image needs to be proportionally placed into its own tile that is 1110 X 1050.
    (Each file should keep its original name) Do the images need to be flattened before this is done?
    Can this be done with photshop actions and/or automator to save time doing it manually?
    The second and third steps are to convert the image to a png and to also create the
    following file sizes/names
    185x175 called  "title".png,
    370x350 called "title"@2x.png,
    555x525 called "title"-ipad.png,
    1110x1050 called "title"[email protected]
    My system is
    Mac OS X version 10.6.8
    Photoshop CS5 version 12.0.4

    Thanks Mylenium for letting me know it can be done And...........
    Any guidance or the how to would be most appeciated, especially the renaming en masse using terminal.
    Thanks!

  • Turn a script into an .exe file?

    Hi,
    How can I turn a JavaScript into an .exe file (on Windows)? The
    advantage is that if the script uses only ScriptUI features, it will
    never need to launch InDesign. Additionally, it is possible to package
    it that way with a special icon that appears if it is placed on the
    desktop, and when it runs the icon appears in the taskbar.
    An example of what I'd look to achieve is the hyphenchecker script,
    written by the late Teus de Jong. There is one Windows-only version
    available on his website (which is still being maintained, probably by
    his son) which is an .exe file -- precisely what I'm trying to do.
    Thanks,
    Ariel

    straight form javascript i don't think there is a way.
    however you can use, i think, Visual Basic (not vbScript!!) as a wrapper for js (using doScript)?

  • Uploading into multiple course

    If I am teaching in multiple courses and I would like to put up the same document into all of my courses, do I have to individually upload the same file into every course or is there another way to do so where I only have to upload once to one course and it can copy over to another course easily?

    Sorry, no. There is not currently a way to upload the same file into multiple destinations or link a file into multiple destinations once it is uploaded.

  • How can I turn a recorded voice into multiple voices that sound like a group of singers?

    I'm using Logic Pro 9. Could someone teach me how to turn a single recorded voice into multiple voices that sound like a group singing together
    by mixing or other techniques ? I don't have the luxury of a group singing together with me when I do recording. Advices would be much appreciated!

    By far the most natural way to achieve this is for the singer to perform multiple takes - even if you've only one singer. At it's simplest, you could just double track the vocal part, although I prefer 3 parts - panned centre, left & right. Then repeat this process for each harmony, & mix accordingly.
    Melodyne & some of the above methods do work on am single voice, but phase cancellation can be an issue if your not careful with each part's timing & panning. If you can only get a couple of decent takes from the singer, far better to perform any harmony/pitching techniques on the second take to avoid any phase issues. It's not uncommon for a singer to perform each vocal part 5-10 times, then comp (edit) the best takes so that you end up with 3 decent takes.
    If you've only only one voice to work with Antares Harmony EFX is a useful alternative.
    http://www.antarestech.com/products/harmony_efx.shtml

  • How to turn on script in chinese (enabled) for sms

    how to turn on script in chinese (enabled) for sms

    I think this is what you are after > http://help.apple.com/iphone/8/#/iphadaaeb5f (International Keyboards) - ÇÇÇ

  • I am looking to turn my iPad into a portable device to store and view multiple files transferred from my pc. I have tried some apps but it does not support multiple sub folder transfers.  Any suggestions please?

    I am looking to turn my iPad into a portable device to store and view multiple files transferred from my pc. I have tried some apps but it does not support multiple sub folder transfers.  Any suggestions please?

    I use GoodReader on my iPad and use the GoodReaderUSB tool. the GoodReaderUSB tool allows you to transfer entire folders into GoodReader without loosing the folder/file structure.
    Windows: http://www.goodiware.com/usb/GoodReaderUSBWin_200.zip
    Mac: http://www.goodiware.com/usb/GoodReaderUSBMac_202.zip

  • How can I stop Compulations CDs from being broken up into multiple different Albums when imported into Itunes?

    I am currently using Itunes 10.6.1.7.  When I attempt to import my CDs, any that are Compulation Cds (with multiple artists), the CDs aren't being imported into the same folder and are broken into multiple listing in my Itunes library.
    How can change this so that they are imported only by Album?

    I think even using Get Info may not reveal the change, though it is possible the behaviour has altered since I last tested it. Playing or updating the tracks location in a script such as UpdateTagInfo seems to get iTunes to re-evaluate the tag.
    Assuming WMP is involved it may be best to make the necessary settings adjustments to prevent further changes, use the script to get all of the background changes exposed within iTunes, then correct as you see fit. Alternatively I do have another script called ExportImport that could be used to back up the current state of your tags (you should temporarily rename the media folder during the export phase), after which you would then run UpdateTagInfo and then use ExplortImport in its import mode to restore the corrupted data.
    tt2

  • Collect data from a dynamic XML file into multiple internal tables

    I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong.
    My XML file is of the following type.It is very complex and the dynamice.
    The following tags occur more than once in the XML file. The "I" and "L" tags and its child tags can occur ones or more than once for each XML file and it is not constant. i.e in one file they can occur 1 time and in another they can occur 100 times.
    "I" and "L" are child tags of <C>
    <I>
           <J>10</J>
             <K>EN</K>
      </I>
    <L>
             <J>20</J>
              <N>BB</N>
      </L>
    Tags <C> and <F> occur only ones for each XML file. <C> is the child tag of "A" and "F" is the child tag of <C>.
    I need to collect <D>, <E> in one internal table ITAB.
    I need to collect <G>, <H> in one internal table JTAB.
    I need to collect <J>, <K> in one internal table KTAB.
    I need to collect <J>, <N> in one internal table PTAB.
    Below is the complete XML file.
    ?xml version="1.0" encoding="iso-8859-1" ?>
    <A>
        <B/>
        <C>
           <D>RED</D>
           <E>999</E>
        <F>
           <G>TRACK</G>
           <H>PACK</H>
        </F>
        <I>
           <J>10</J>
           <K>EN</K>
        </I>
        <I>
           <J>20</J>
           <K>TN</K>
        </I>
        <I>
           <J>30</J>
           <K>KN</K>
        </I>
        <L>
           <J>10</J>
           <N>AA</N>
        </L>
        <L>
           <J>20</J>
           <N>BB</N>
        </L>
        <L>
           <J>30</J>
           <N>CC</N>
        </L>
        </C>
      </A>
    With the help of SDN I am able to gather the values of <D> <E> in one internal table.
    Now if I need to gather
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    I am unable to do. I am following  XSLT transformation method. If some one has some suggestions. Please help.
    Here is my ABAP program
    TYPE-POOLS abap.
    CONSTANTS gs_file TYPE string VALUE 'C:\TEMP\ABCD.xml'.
    * This is the structure for the data from the XML file
    TYPES: BEGIN OF ITAB,
             D(10) TYPE C,
             E(10) TYPE C,
           END OF ITAB.
    * Table for the XML content
    DATA: gt_itab       TYPE STANDARD TABLE OF char2048.
    * Table and work ares for the data from the XML file
    DATA: gt_ITAB     TYPE STANDARD TABLE OF ts_ITAB,
          gs_ITAB     TYPE ts_ITAB.
    * Result table that contains references
    * of the internal tables to be filled
    DATA: gt_result_xml TYPE abap_trans_resbind_tab,
          gs_result_xml TYPE abap_trans_resbind.
    * For error handling
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    * Get the XML file from your client
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = gs_file
      CHANGING
        data_tab                = gt_itab1
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Fill the result table with a reference to the data table.
    * Within the XSLT stylesheet, the data table can be accessed with
    * "IITAB".
    GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
    gs_result_xml-name = 'IITAB'.
    APPEND gs_result_xml TO gt_result_xml.
    * Perform the XSLT stylesheet
    TRY.
        CALL TRANSFORMATION zxslt
        SOURCE XML gt_itab1
        RESULT (gt_result_xml).
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    * Now let's see what we got from the file
    LOOP AT gt_ITAB INTO gs_ITAB.
      WRITE: / 'D:', gs_ITAB-D.
      WRITE: / 'E :', gs_ITAB-E.
    ENDLOOP.
    Transformation
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <IITAB>
              <xsl:apply-templates select="//C"/>
            </IITAB>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <item>
          <D>
            <xsl:value-of select="D"/>
          </D>
          <E>
            <xsl:value-of select="E"/>
          </E>
        </item>
      </xsl:template>
    </xsl:transform>
    Now the above pgm and transformation work well and I am able to extract data into the ITAB. Now what changes should I make in transformation and in pgm to collect
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    Please help..i am really tring hard to figure this out. I am found lot of threads addressing this issue but not my problem.
    Kindly help.
    Regards,
    VS

    Hi Rammohan,
    Thanks for the effort!
    But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.
    Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields.  I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.
    Moreover I have about 10 such work areas.  so the effort would be ten times the above effort! I want to avoid this! Please help!
    I would be very grateful if you could provide an alternative solution.
    Thanks once again,
    Best Regards,
    Vinod.V

  • Inserting filename and page numbers into multiple PDF files?

    Have since seen this thread, BUT still interested in the syntax of the code
    to insert filename and page # into multiple files:
    http://forums.adobe.com/thread/951925?tstart=0
    Good Evening (GMT!)
    I have approx 100 PDFs with one or two pages in each, they are English translations
    of Russian language test certificates and the formatting/feel of the originals is lost in
    the translations. The only real link between the two sources is the "_RUS" and "_ENG"
    filename suffixes and the common leading filenames otherwise. Thus I need to maintain
    a record of the filename in any page I print off, should there be a need to refer back to
    the original if the translation is open to artistic licence.
    I have a script (below) that happily adds a page x/y and filename into the active file,
    what I would like is to be able to do this insertion into multiple files as defined by a
    portfolio or a selection via a select files dialogue box
    I am quite out of my depth now as my past skirmishes with JavaScript have set
    cookies and tweaked a few other browser doodads in webauthoring
    Any help most appreciated on this one...
    Kind Regards
    Dr B
    Southampton
    UK
    NB the filename inserted may be corrupted as a result of my last tweakings
    will sort that one out ASAP....
    ================================
    // SetRemoveFooter
    // Modified as marked
    // Menu item generation
    app.addSubMenu({ cName: "Footer",cUser: "Set/Remove Complex Footer", cParent: "File", nPos: 20 });
    app.addMenuItem({ cName: "Set Filename", cParent: "Footer", cExec: "SetFooter(1)"});
    app.addMenuItem({ cName: " -> Set Date .... centered", cParent: "Footer", cExec: "SetFooter(2)"});
    app.addMenuItem({ cName: " -> Set Date .... right", cParent: "Footer", cExec: "SetFooter(3)"});
    //add page x of y
    app.addMenuItem({ cName: "Set Page ", cParent: "Footer", cExec: "SetFooter(4)"});
    app.addMenuItem({ cName: "Set Both", cParent: "Footer", cExec: "SetFooter(5)"});
    app.addMenuItem({ cName: "-------------------------------", cParent: "Footer",cExec: "{}"});
    app.addMenuItem({ cName: "Remove Both", cParent: "Footer", cExec: "RemoveFooter(5)"});
    app.addMenuItem({ cName: "Remove Date Time (Filename)", cParent: "Footer", cExec: "RemoveFooter(1)"});
    app.addMenuItem({ cName: "Remove Page", cParent: "Footer", cExec: "RemoveFooter(4)"});
    //=====================================================================================
    //Set/remove Footer
    function SetFooter(ARG)
    var re = /.*\/|\.pdf$/ig;
    var FileNM = + this.path.replace(re,"")+".pdf";
    var Path = this.path;
    var AcDate = new Date();
    var AcDateFormat = "dd/mm/yyyy"
    var Box2Width = 100
    for (var p = 0; p < this.numPages; p++)
    var aRect = this.getPageBox("Crop",p);
    var TotWidth = aRect[2] - aRect[0]
    if (ARG<=3 || ARG==5)
    {var fd = this.addField("xftDate", "text", p, [30,15, TotWidth-30-30,30]);
    //print output?
    fd.value = util.printd(AcDateFormat, AcDate) + " (" + FileNM +")";
    // TEXT SIZE SETTING
    fd.textSize=12; fd.readonly = true;
    if (ARG==1){ fd.alignment="left" };
    if (ARG==2){ fd.alignment="center" };
    if (ARG==3){ fd.alignment="right" };
    if (ARG==4 || ARG==5)
    {var bStart=(TotWidth/2)-(Box2Width/2)
    var bEnd=((TotWidth/2)+(Box2Width/2))
    var fp = this.addField(String("xftPage"+p+1), "text", p, [bStart,30,bEnd,15]);
    // print output?
    fp.value = "Page: " + String(p+1)+ "/" + this.numPages;
    // TEXT SIZE SETTING
    fp.textSize=12; fp.readonly = true;
    fp.alignment="center";
    //==========================================================================
    function RemoveFooter(ARG)
    if (ARG<=3 || ARG==5) {var x = this.removeField("xftDate");}
    if (ARG==2 || ARG==5) {for (var p = 0; p < this.numPages; p++)
    var x = this.removeField(String("xftPage"+p+1)); }
    will

    Putting this in a batch file within the automation function of Acrobat
    delivers the goods, I need to investigate the formatting of the output to
    get them to line up, have taken the middle ground and gone for a central
    position for the page x/y text...... some lines are redundant
    Dr B
    ===========================================
    var re = /.*\/|\.pdf$/ig;
    var FileNM = this.path.replace(re,"")+".pdf";
    var Path = this.path;
    var AcDate = new Date();
    var AcDateFormat = "yyyy/mmm/dd  HH:MM"
    var Box2Width = 50
    for (var p = 0; p < this.numPages; p++)
    var aRect = this.getPageBox("Crop",p);
    var TotWidth = aRect[2] - aRect[0]
           var fd = this.addField("xftDate", "text", p, [30,15,
    TotWidth-30-30,30]);
           fd.value =  FileNM;
           fd.textSize=12; fd.readonly = true;
           fd.alignment="left";
    var bStart=(0);
    var bEnd=(TotWidth);
           var fp = this.addField(String("xftPage"p1), "text", p,
           fp.value = "Page: " + String(p1) "/" + this.numPages;
           fp.textSize=12;  fp.readonly = true;
           fp.alignment="center";

  • Duplicate object into multiple selected frame

    I’m looking for a script that will duplicate the selected object or the content of the clipboard into multiple selected layers inside a document.
    I have not find any discussions around this, but I’m asking if anyone have already seen such script.
    Thanks
    Jean-Claude

    Jean-Claude try the following one:
    1. Should work with a single object, multiple objects, group
    2. Should alert a warning, if you select nothing or select some text
    3. Will not honor, if layers are hidden or locked
    Does it work for you?
    // duplicate on different layers _b02
    // by Kai Rübsamen, credits to Hans Haesler
    // vorbeugenderweise das Anzeigen von Dialogen aktivieren
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    // prüfen, ob ein Dokument geöffnet ist
    if ( app.documents.length == 0 ) {
        alert ( "Warning\rOpen a document!" );
        exit();
    // die Auswahl speichern ...
    var allSel = app.selection;
    var nItems = allSel.length;
    // und prüfen
    if ( !nItems ) {
        alert ( "Warning\rSelect something!" );
        exit();
    if ( nItems == 1 && app.selection[0].hasOwnProperty("baseline") ) {
        alert ( "Warning\rDoes not work with text. Select only frames!" );
        exit();
    var curDoc = app.activeDocument;
    var allLayers = curDoc.layers;
    var nLayers = allLayers.length;
    // eventuell vorhandene Dialoge entfernen
    try {
        app.dialogs.everyItem().destroy();
    catch (e) {
    var layerNames = new Array();
    for ( var i = 0; i < nLayers; i++ ) {
        layerNames.push( allLayers[i].name );
    // eventuell vorhandene Dialoge entfernen
    try {
        app.dialogs.everyItem().destroy();
    catch (e) {
    // den Dialog vorbereiten ...
    var dlogCheckList = new Array();
    var aDialog = app.dialogs.add({ name: "Duplicate object to selected layers", canCancel: true });
    with ( aDialog ) {
        with ( dialogColumns.add() ) {
            with ( dialogRows.add() ) {
                staticTexts.add({ staticLabel: "active = duplicate"} );
                for ( var n = 0; n < nLayers; n++ ) {
                    with (dialogRows.add()) {
                        dlogCheckList.push( checkboxControls.add({ staticLabel: layerNames[n] }));
    // ... anzeigen und die Wahl des Anwenders anwenden
    if ( aDialog.show() == true ) {
        for ( var k = 0; k < dlogCheckList.length; k++ ) {
            var curCheckBox = dlogCheckList[k];
            if ( curCheckBox.checkedState ) {
                var curLayer = curDoc.layers.itemByName( layerNames[k] );
                for ( var i = nItems-1; i >= 0; i-- ) {
                    var curSel = allSel[i];
                    curSel.duplicate( curLayer );
        aDialog.destroy();
    else {
        aDialog.destroy();
    –Kai

  • How to Export Multiple Compositions Into Multiple Folders With Metadata?

    Currently I am working on a project which requires the export of one video file into multiple sizes and formats. In the end there are 80+ separate video files which derive from basic groupings of ratios. As you can see by the attached pictures, I have set up a waterfall type procedure in which a master composition with safe margins is inserted into the various sub-ratios until it trickles down into the final sizes at the bottom.
    I know you can simply drag and drop the files from After Effects into Media Encoder after selecting a preset to export the items. My only issue is how can I export the 80+ video files into 80+ different folders (depending on the size/ratio) along with the proper metadata?
    So my thought became is there a way to automate the process by allowing me to create on video, and much like the watch folder, export the one master video and then let Media Encoder work its magic with the 80+ other videos?
    Thanks in advance.

    Unless you care to create 80 output presets in AME I don't see it working and then even I wouldn't rely on it. AME is too notoriously error-prone. It would probably be simpler and less nerve-wrecking to create an AE script that sets up your AE render queue and creates the folders and render directly from AE...
    Mylenium

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Splitting TempDB into multiple data files.

    To avoid contention we have to split tempdb into multiple data files. But as for case suppose, there is 20 GB total space is on the drive containing 1 tempdb data file of 15 GB. And I have to create 3 more tempdb data files, and as recommendation all files
    should be of same size.Then how to handle this situation and configure all data files with same size?
    Pranshul Gupta

    But as for case suppose, there is 20 GB total space is on the drive containing 1 tempdb data file of 15 GB. And I have to create 3 more tempdb data files, and as recommendation all files should be of same size.Then how to handle this situation and configure
    all data files with same size?
    So your goal is to have 4 tempdb files, each 5GB?  Below is a sample script to accomplish the task within the 20GB space constraint.
    --reduce size of existing file to 5GB
    ALTER DATABASE tempdb
    MODIFY FILE (NAME='tempdev', Size=5GB);
    DBCC SHRINKFILE('tempdev',5120);
    --add 3 new 5GB files
    ALTER DATABASE tempdb
    ADD FILE (NAME='tempdev2', FILENAME='D:\SqlDataFiles\tempdb2.ndf', Size=5GB);
    ALTER DATABASE tempdb
    ADD FILE (NAME='tempdev3', FILENAME='D:\SqlDataFiles\tempdb3.ndf', Size=5GB);
    ALTER DATABASE tempdb
    ADD FILE (NAME='tempdev4', FILENAME='D:\SqlDataFiles\tempdb4.ndf', Size=5GB);
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Splittling numbers in one field into multiple sections

    Good Morning,
    I am currently working on a project where a user inputs required information on digital entry form, which then auto populates the inputted data onto multiple documents. While a majority of the data maintains the same format integrity throughout the documents, I am running into issues with documents that deviate from that standard input format. For example, when users enter the following numbers, they are entered as one line of text:
    However, the output on a required document splits these numbers into multiple sections:
    The output document is not maintained by my organization and I cannot make changes to the document formatting. Can anyone assist me in finding a way to split the single line text into the mutliple fields as shown? 

    If you're importing the form data into the second form, create the NCPDP# field and make it hidden. The create three visible fields to hold the three parts of the number, for example: NCPDP2.1, NCPDP2.2, and NCPDP2.3
    You can then use a custom Validate script for the hidden NCPDP field that's something like the following:
    // Custom Validate script
    (function () {
        // Do nothing if field is blank
        if (!event.value) return;
        // Populate the other fields if the string length is correct
        if (event.value.length === 7) {
            getField("NCPDP2.1").value = event.value.slice(0, 2);
            getField("NCPDP2.2").value = event.value.slice(2, 6);
            getField("NCPDP2.3").value = event.value.slice(6);
        } else {
           // What do you want to do here if the string length isn't 7?
    Look up the slice string method in any decent JavaScript reference for more informatio on how it works. Note that you can make the subfields into combs fields to match the spacing of the boxes.

  • Split TempDB Data file into multiple files

    Hey , 
    I have been seeing TempDB contention in memory on our SQL server 2012 Enterprise Edition with SP2 and I need to split TempDB Data file into multiple files .
    Could someone please help me to verify the following information:
    1]
    We are on SQL server 2012 Enterprise Edition with service pack2 but as per SQL Server 2012 Enterprise Edition under CAL Licensing –We are limited to use 20 logical processors instead 40 logical processors. Our SQL is configured
    on NUMA nodes and with the limitation SQL uses only 2 NUMA nodes on live .There are 10 logical CPUs are evenly assigned to each NUMA nodes. Microsoft recommends that if SQL server configured on NUMA node and we have 2 NUMA nodes, then we may add two data files
    at a time. Please let me know should I add two TempDB data file at a time?
    2] We have TempDB Data and log files both on the same Drive of SQL server  .When I split TempDB into two Data files, I can get them on the same Drive .What your recommendation should I need to create TempDB Data files on the same drive or on separate
    disks?
    3] What would be the blackout plan for splitting the tempdb into multiple files? Please let me know if someone has a better back out plan ?
                1] Run script that create tempdb Database with a single file
    2] Reboot SQL service in order to apply change   
    Your help will be apprecited .
    Thanks ,
    Daizy

    Tom , I am seeing TempDB contention on Production server when there is a heavily load on sql server . We also experiencing the overall system slowness.Please look at Pagelatch wait statistics on our server ,Please advise .
    wait_type
    waiting_tasks_count
    wait_time_ms
    max_wait_time_ms
    signal_wait_time_ms
    PAGELATCH_UP
    2680948
    3609142
    10500
    508214
    PAGELATCH_SH
    1142213
    1338451
    8609
    324538
    PAGELATCH_NL
    0
    0
    0
    0
    PAGELATCH_KP
    0
    0
    0
    0
    PAGELATCH_EX
    44852435
    7798192
    9886
    6108374
    PAGELATCH_DT
    0
    0
    0
    0
    Thanks ,
    Daizy

Maybe you are looking for

  • Report displayed on PDF

    I created a simlpe report. When I call it from the button in my form, I would like to have acrobat pop up and display it on the screen. So far, when the user clicks the button, my form creates the a pdf file with the report on it. But it does not ope

  • Insert BASE tag into HTMLDocument problem

    Hi, I've made a prog that read the HTML content from an URL, and write it into a file. But before writing it, I'd like to change the content to add <BASE href="http://www.site.com"></BASE> into the head part of the HTMLDocument. In my prog, I've made

  • Shopping cart-onmouseup

    Hi to everybody! I�m trying to do somethin similar to a shopping car. So i have got a list of many products, and each product has a textFiedl to insert the number of products you want. So after inserting the number of products you want from this prod

  • MBA 2012 shut down time

    What is the normal range of shutting down a MBA 2012, mine seams not right

  • Issue while uploading the document with VA02 and VA03

    Hello Experts, Can any body please help me out from this issue, as while uploading the PDF's, docs from VA02, VA03 in ECC6 EHP7 system. Steps to reproduce the issue - TX. VA02 --> service object --> create an attachment then we are facing like below