Loading ...
Sorry, an error occurred while loading the content.

11315Re: [Clip] Database Spit Clip

Expand Messages
  • Dick Gascoigne
    Dec 1, 2003
      Chris -
      To break on semicolon, after the Jump you need to search backward for the ;
      You can get closer to the 1MB target by using MoveCursor to move by
      characters instead of line.

      Better, I think to look at the FTP solution.

      Dick Gascoigne
      Singapore


      ----- Original Message -----
      From: "Jody" <kjv-av1611@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Tuesday, 02 December, 2003 12:33 AM
      Subject: Re: [Clip] Database Spit Clip


      > Hi confesschrist,
      >
      > :) Are you the Chris that I know?
      >
      > >Anyways, I have a SQL database that is around 60mb. I need to split
      > >the database into smaller chunks, around 1mb or less. I am told that
      > >the splits must be made after the semi-colons. Is there a clip
      > >available that will do this? I can split the file by hand, and at
      > >around 18,000 lines I get pretty close to 1mb. It doesn't have to be
      > >precise. I just need to split the database so I can upload it via http
      > >(I don't have ssh access).
      >
      > Don't you have ftp access?
      >
      > I only tested this with doing two lines at a time. But it should
      > work for you. It does not edit the original document. It saves
      > each 18000 lines with the original name and location, but uses an
      > incremental number for each one saved: file1.ext, file2.ext,...,
      > file999.ext. See the note in the long Clip about using ^!Close Discard...
      >
      > <--- Copy below this line --->
      > H=Split at 18000
      > ; eMailed on 12-01-2003 ntb-clips@yahoogroups.com, Jody
      > ; notetab.net, clean-funnies.com, fookes.us, sojourner.us
      >
      > ^!SetHintInfo Working...
      > ^!SetScreenUpdate Off
      > ^!Set %DocIndex%=^$GetDocIndex$
      > ^!Set %n%=1
      > ^!Set %PathName%=^#; %ext%=^$GetExt(^##)$
      > ^!Jump Doc_End
      > :EmptyLine
      > ^!IfFalse ^$IsEmpty(^$GetLine$)$ Skip_2
      > ^!Replace "^p" >> "" SB
      > ^!Goto EmptyLine
      > ^!InsertText ^p
      > ^!Jump 1
      >
      > :Loop
      > ^!Set %Start%=^$GetRow$:^$GetCol$
      > ^!Jump +18000
      > ^!Clip "GetTextTop"
      > ^!SetClipboard ^$GetTextTop$
      > ^!Toolbar Paste New
      > ^!Save As "^%PathName%^%n%^%ext%"
      > ^!SetDocIndex ^%DocIndex%
      > ^!Inc %n%
      > ^!If "^$GetRow$" => "^$GetLineCount$" Next else Loop
      > ; ^!Close Discard would be better below for resource
      > ; purposes since your file is so big.
      > ^!Toolbar Reload Document
      >
      >
      > H=_GetTextTop
      > ; Last updated 11/20/2001, Jody@...
      > ; http://www.notetab.net, http://www.notetab.net/order
      > ; Working example of a custom function that gets the text
      > ; from the cursor point to the top of file. Use Clip
      > ; TextTop to see the value of the custom function.
      > ^!SetScreenUpdate Off
      > ^!SelectTo ^%Start%
      > ^!Result ^$GetSelection$
      > ^!Jump Select_End
      >
      >
      > H=TextTop
      > ; Last updated on 05-08-2002, 07:04pm, jody
      > ; http://www.notetab.net, http://www.notetab.net/order
      > ; Working example of a custom function that gets the text
      > ; from the cursor point to the top of file. Use this Clip
      > ; to see the value of the custom function.
      > ^!Info ^$GetTextTop$
      >
      >
      > <--- Copy above this line --->
      > <--- Right click over a Library --->
      > <--- Choose: Add from Clipboard --->
      >
      >
      > Happy Clip'n!
      > Jody
      >
      > http://www.notetab.net/html/cd-info.htm
      > http://www.notetab.net/html/maillist.htm
      >
      > Subscribe, UnSubscribe, Options
      > mailto:ntb-Clips-Subscribe@yahoogroups.com
      > mailto:ntb-Clips-UnSubscribe@yahoogroups.com
      > http://groups.yahoo.com/group/ntb-clips
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
      >
    • Show all 17 messages in this topic