Break a file .rtf with new names

Hello

I have a huge rtf file which I hope to break in different files based on an identifier that is at the top of each part I want to break up.

These files should still be rtf as they all html links I need to keep.

The structure of the file is:

3 RETURN of CART then the word MOVIE (uppercase) or a CARRIAGE RETURN following.

The identifier to break the file must therefore this sequence.

And after the word FILM and a carriage return, I have the actual film title, ideally I would like to use the title of the film as the new file name.

Many thanks for any help

Hello

This script works on the tested document being the application "TextEdit" on EL Capitan.

The format of the new document must be "RTF" (not "plain text") in the preferences "TextEdit".

-----------------------------

the value of the path to the folder on the desktop folderPath as string - the destination folder where to put the new RTF files

-Choose the end of the line of text (the carriage return or line feed) RTF

RC for return - value <-carriage return

-the value of rc linefeed - <-line break

the searchString 'MOVIE' & rc value

Tell application "TextEdit".

say (get before document)

the value of tc to count points

start_Line value 1 - the line of departure of the first part

in view of the case

Repeat with i from 1 to Transport Canada

If (get the paragraph I) = searchString then -'MOVIE' and carriage return

If (get paragraph i - 1) (get paragraph i - 2) and rc is rc then - two blank lines before 'MOVIE' (carriage return), and carriage return

the value movTitle in the paragraph (i + 1) - get the title

say movTitle to if it ends with rc and then assign movTitle text 1 thru-2 - remove the transport back in the title of the film

My newRtfDocAndSave (start_Line, i + 1, folderPath & movTitle & ".rtf", it)

value start_Line i + 2 - the line starting from the next part

end if

end if

end repeat

end in view

tell the end

tell the end

on newRtfDocAndSave (n1, n2, f, tDoc)

Tell application "TextEdit".

the value of newDoc to new document

Duplicate (paragraphs n1 by n2 tDoc) in the first paragraph of the newDoc - part copy rtf text in the current document to the new document

close newDoc save Yes save file f - save and close the new document

tell the end

end newRtfDocAndSave

Tags: Mac OS & System Software

Similar Questions

  • I have a script that ended up saving a file under a new name whenever I generate the script.

    I have a script that ended up saving a file under a new name whenever I generate the script on the same image.

    Moving to Scripting Photoshop

  • How can I load file rtf with control of JavaFX?

    Hello
    How can I load file rtf with control of JavaFX?
    I would like to show the contents of the rtf file, I can't find any solution. Do you have any suggestions?

    Thank you

    Published by: imtoocute on August 2, 2012 11:01

    Google revealed this link:
    http://www.codeproject.com/tips/136483/Java-how-to-convert-RTF-into-HTML

    The link is based on an old RTF converter that is built into the jdk and some swing classes - so don't expect a conversion out of it, but it seems by far the best way to perform such a conversion. Depending on your document display requirements of loyalty it might OK for what you are trying to do.

    Other more complex solutions are things like http://www.artofsolving.com/opensource/jodconverter/ jodconvertor that would probably give a higher quality conversion, but is a solution much more heavy weight (based on Open Office converters to perform the actual conversion).

    This kind of thing is also a candidate for service transformation server where you would spend the rtf document in a http post and the conversion would be done on a server, then the converted document is passed back in the http response.

    Once you have the rtf html string, you can use webview.getEngine () .loadContent to display the HTML resulting.

  • How can I register all of the VMX files found in a list of stores of data with new names

    Hello-

    I'm trying to find a way to search through a given list of data and each discover a warehouse. VMX file, add this machine in the inventory I want to prepend the name of the machine as something different. That is to say, instead of "Machine1", I wish it were registetred as "auto-Computer1.  So, imagine I have an empty data center with 4 warehouses of data stored in a table $arrDatastoreToInclude.  I want to loop through each of these data stores and add all the VMX files I found back in the inventory.

    I know that I can use the following to get data warehouses I want:

    $dsindatacenter = get-data center $DataCenterName | Get-Datastore? | {$arrDatastoreToInclude - contains $_.} Name}

    But I have no idea how to analyze these data stores for the VMX files and what command to add them in the inventory.  Can anyone help?

    Try the following, it is based on the script of the position that Robert mentioned.

    You will need to provide a file (in $VMFolder) where unregistered virtual machines will be stored.

    The Set-VM cmdlet will take care of the rename.

    $DatacenterName = "MyDatacenter" $arrDatastoreToInclude = "DS1","DS2","DS3","DS4"
    
    $dc = Get-DataCenter $DataCenterName $dsindatacenter =  Get-Datastore -Datacenter $dc | ?{$arrDatastoreToInclude -contains $_.Name}
    
    $VMFolder = "MyFolder"
    $ESXHost = Get-VMHost -Location $dc | select -First 1
    foreach($Datastore in $dsindatacenter) {
        # Collect .vmx paths of registered VMs on the datastore     $registered = @{}
        Get-VM -Datastore $Datastore | %{$_.Extensiondata.LayoutEx.File | where {$_.Name -like "*.vmx"} | %{$registered.Add($_.Name,$true)}}
    
       # Set up Search for .VMX Files in Datastore    New-PSDrive -Name TgtDS -Location $Datastore -PSProvider VimDatastore -Root '\' | Out-Null    $unregistered = @(Get-ChildItem -Path TgtDS: -Recurse |         where {$_.FolderPath -notmatch ".snapshot" -and $_.Name -like "*.vmx" -and !$registered.ContainsKey($_.Name)})
        Remove-PSDrive -Name TgtDS
       #Register all .vmx Files as VMs on the datastore   foreach($VMXFile in $unregistered) {
            New-VM -VMFilePath $VMXFile.DatastoreFullPath -VMHost $ESXHost -Location $VMFolder |
            Set-VM -Name ("Auto-" + $_.Name)
       }
    }
    

    Unregistered virtual machines will be saved with Displayname that is present in the VMX file.

    If this would cause a conflict with VM already registered, you can use the Name of the cmdlet New-VM parameter

  • After scanning in a file, I can't save the PDF file with a unique file name, it will only back up in its original name; Otherwise, if I save the name of the file under a new name, save it box goes outside and the file is renamed and saved. Help!

    If I analyze the file and its original name is:

    Ssrv395alm76439... and I want to rename it "background."

    If I have the rename, the file won't save. If I leave the file as it will save and I have to go to an additional folder and rename it.

    Help, it's too long. I just click on "Save as" and rename and save the document in the necessary folder at a time!

    Hi Allisonchristinele ,

    Please provide the exact point of the software & OS installed on your system. Also check if it is there any update available for the software after crossing "" help > check updates "»

    Follow this thread to reset the Acrobat preferences:- How to reset preference settings in format Acrobat.

    Like 'save' will save the changes with the file & "save under" will give the window using which can save the file to any location on the system.

    I would like to know is what is happening with some or all the files.

    Also, please try to check with the different user account to reproduce the problem.

    Kind regards

    Christian

  • After update 24.4.0 (Linux) the Inbox, Sent, Trash, Outbox and project files appear with their names in English, instead of my locale.

    After Linux Thunderbird updated to 24.4.0, records 'system' (smells, Trash, Inbox...) now appear with their names in English, instead of in my locale, as they appear in the previous version.

    How to 24.4.0?

  • How can I select the files in a folder with the help of a list with the files you want and after that rename only the files using another list with desired new names?

    How can I select the files in a folder with the help of a list with the files you want and after that rename only the files using another list with desired new names?

    I have only:
    D: / images (where are necessary + not need files)
    -a list with only the necessary files
    -a list with new names for the files needed
    Thank you.

    Hi Pustiu,

    Thanks for posting in the Microsoft Community.

    You want to know how to select the files in a folder using a list with the files you want and after that rename only the files using another list with desired new names.

    I would have you post your query in the TechNet forums because it caters to an audience of it professionals.

    Your query will be better addressed there.

    Check out the link-

    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/threads

    We know if you need help. We will be happy to help you. We, at tender Microsoft to excellence.

    Thank you.

  • Emails sent with the name of bad people

    I have windows 7 and when I send photos or files from my documents to the recipient of the message. Opening with Yahoo it shows sent by name of different people, but my email. Opening with Hotmail it of ok if I make a new message and attach the file or the pictures it seems to send ok with yahoo or Hotmail. What is going on?

    Duplicate the content of the Post-

    photos or files sent with fake name but just to send documents.

    When I send photos or files from my documents to a message recipient yahoo account it send with my email but another persons name. . But if I attach the photo or file in the new mail, it sends it's ok. Noticed that when sent to the recipient of the message name Hotmail account and the email is correct what is wrong.

    Hi RaymieSanchez,

    1 are you facing issue when you try to send a mail to the Yahoo account?

    2. does this happen that with any specific account send you emails with an attachment?

    This may be related to certain issues related to the contacts stored in the Yahoo account or some settings need to be changed in the account.

    You can get in touch with the support of Yahoo and check if it helps:

    Yahoo Mail Help

  • Cultivated file InDesign with the same content from 40 MB to 430 MB

    Hello

    I have a recurring project where still the same PDF with vector content are included. The InDesign file still had about 40 MB.

    Since the update to CC new files .indd suddenly rose to 230 MB and the next step to 430 MB.

    I re - save the file under a new name, when a new corrections come, so I can revert to the last version and track changes, there are about 120 pages, with about 60 paintings and 35 graphics that have been opened and color to CMYK in Illustrator.  From the 40 to the 430 MB, nothing has changed on my course of action... How can this be what can I do?

    Thank you!

    Hallo,

    ICH habe ein wiederkehrendes Projekt in dem immer die gleichen pdfs mit Vektor Inhalt sind included. InDesign die Datei dazu had immer die 40 MB.

    Seit dem update auf CC sind die neuen .indd files keep auf 230 grown, und beim abspeichern dann auf 430 MB next.

    ICH speichere Dateien, wenn ein Schwung Korrekturen kommt immer neu ab, damit ich zur last Version back kann, kann ich nachverfolgen therefore, wann die Daten sind grown... so der Inhalt ist immer too equal, are approx. 120 Seiten sind, mit ca. 60 internal 35 diagrams, die als pdf und mit Illustrator open und sleeps in CMYK eingefarbt wurden. Von den 40 bis zu den 430 MB hat sich an meiner do nichts geändert... wie kann das breast, was tun kann ich steer?

    Danke!

    Sometimes it's better when you change the version of Indesign to use file > export and choose IDML

    Then open that in the new version of Indesign.

    You can do this with your current files and see if the problem is resolved.

  • Save the file with the new name (no rename)

    Is it away when open the file and after changing to save under a new name in order to have the original and edited files in my documents?

    Hi plammca,

    I regret that there is no option to save a file with a different name after the change. However, there is a workaround that you can try.

    • Select the file you need to make changes.
    • Create a duplicate file and then rename it.
    • Now, you can make changes to in the file duplicate.

    Let us know if that helps.

    Kind regards

    Meenakshi

  • I've just updated my bios and have a text file in a new disk with error

    I just updated my bios, and I think that every thing went smooth.the bios version in the menu of the bios appear to be new version when I log on windows a partision again with the name "HP_TOOLS" is there with a file named 'the hp bios update.

    with this text

    01/07/13 17:23:11 update BIOS HP EFI 2.7.1.0 began
    01/07/13 17:23:11 init SMBIOS data Failed

    shoud this I mean shoud update of the bios again.

    What shoud I do to remove the new partision if it is not needed.

    Please help thanyou beforehand.

    If the BIOS rev display properly when you restart, then the update was very good. The HP_Tools partition is small and is used for the diagnosis and recovery of the BIOS. I suggest that you keep the partition, unless you absolutely need the space

  • The listener is down: even if a listener with the name "AUDITOR", is running on this host at the port: "1521", it has not started using "the target LISTENER. ORA file.


    I moved a listener on a host in a House different oracle. The headset works fine, but EM 12 c shows that the listener is down with the following summary:

    The listener is down: even if a listener with the name "AUDITOR", is running on this host at the port: "1521", it has not started using "the target LISTENER. ORA file. CORRECTIVE ACTION: To monitor this "EM listener target" with its current configuration, you must stop the process of listening running and start it using the Listener parameter file: opt/oracle/product/12.1.0.2/network/admin/listener.ora. Alternatively, you can update "this target LISTENER. Location ORA setting"with the location of the listener running, which started using the: opt/oracle/product/11.2.0.3/network/admin/listener.ora.

    EM 11 g, I simply changed the configuration of the listener for the different oracle home, argued the change and in a few minutes the listener would show that 'UP' with the oracle of new home. I upgraded to MS 12 c (12.1.0.4) and can't find how to do this. Can someone give me the procedure.

    Thank you

    Ron

    Hi Ron,

    Can you please do the following?

    -Create a for the listener listener.ora file, stop and start the receiver using the listener.ora file. If the file is located in a default location, set the TNS_ADMIN environment variable to that location before you start the listener.

    -Log on to the EM console, go to the homepage of the listener.

    -In the Oracle Listener menu, select target Configuration > Configuration of the analysis.

    -Ensure that the parameters, including the Listener.ora directory, are properly.

    Kind regards

    -Loc

  • name the file exported with date

    Hi, I use this command to export my schema

    exp file = c:\expdat.dmp med/med

    I think that if I use the same command over and over again, it will replace the old file with the new one? right?

    2. I want to name the file exported with the sysdate (date and time)? , and I think it's a way to create a new file and does not replace the old file.

    Thank you

    Here is an example of adding a date for a file name:

    > exp med/med file=c:\expdat.%date:~10,4%%date:~7,2%%date:~4,2%.dmp

    To add as a data and once, you just need something based on time that is unique, so try something like:

    > exp med/med file=c:\expdat.%date:~10,4%%date:~7,2%%date:~4,2%.%time:~1,1%%time:~3,2%%time:~6,2%%time:~9,2%.dmp

  • Restore the backup with a new name and a different location on the same server

    Hi all

    I did a complete backup of my current PROD. Is it possible to restore the database on the same server, but with a different instance name, db_name and on another location?

    PRM says:
    Hi all

    I did a complete backup of my current PROD. Is it possible to restore the database on the same server, but with a different instance name, db_name and on another location?

    If you use RMAN my awnser is not.

    You cannot change the name of the database before open resetlog.

    But you can make this work without problem using the same server.

    You will need to change some parameters.

    Create a PFILE from SPFILE (prod) change parameter 'db_unique_name' file new name (ex TEST).

    Change all the value of PROD TEST except db_name parameter must be PROD.

    CREATE a SPFILE from this PFILE (spfileTEST.ora)
    Create a new password file (orapwTEST)

    So you can start this new Instance_name (TEST).

    Restore the PROD to TEST instance database, you will need use set new name to the file data or database (depends on which version you use)

    Retrieve the instance PROD database (TEST)

    It is time to open resetlogs...
    !!!!!!!!!!!!!!!!!!!!!!!!!!!! ATTENTION HERE!

    You need change redo log location before open resetlogs, you must query v$ logfile member column and change it to another location.

    After change you can open resetlog.

    Now its time to change name of database.

    Stop and start Mount

    Use the NEST

    NEST target=sys/password@instance DBNAME = TEST

    When this process is complete, NEST will be closing database.

    So you will need to start with nmount change db_name to the TEST and reset the parameter 'db_unique_name' (alter system reset db_unique_name)

    Then stop and start upstairs question OPEN DATABASE RESETLOGS and is done.

    HTH,
    Levi Pereira

    Published by: Levi Pereira on August 27, 2012 13:09

  • Number of folders in my files with strange names

    I have installed 11 items, imported images, now have thousands of files with strange names.

    Still for delete.

    I tried to uninstall and reinstall items, but the foders were still there.

    How bulk can remove these files, or manually uninstall so that I can remove all items?

    Screen Shot 2013-04-05 at 5.45.41 PM.png

    I seem to have solved the problem.

    I deleted "My catalog", after making a new catalog (required).

    On importing for the first time, I selected 'images' of file import.

    This time, instead, I chose all files from inside 'images' & the right file names are given, and none of the thousand of false records appear.

    Also may be a factor? I have my mac os x "photos" folder on a 2nd drive internal alias the original position of the OS disk.

    Post edited by: ianwbarnett

Maybe you are looking for

  • AutoFill does not.

    My AutoFill is no longer present on the toolbar and I can not find where to change personal information such as the credit cards etc. I don't want to automatically fill in the password, but the credit cards etc. The old auto-fill button is gone and n

  • How to enter a foreign contact in the address book?

    How to enter a foreign contact in the address book? Hello How can I enter an alien contact in the address book, without affecting other household contacts? I'll card > add field > model > General and change in the country, but it acts on all contacts

  • Upgrade XP Home Edition

    My hard drive crashed. I reinstalled from original CD (XP Home Edition), but have only access to IE6 is no longer supported by MS websites.  Tried upgrading to IE7, but receive error message that IE7 requires at least SP1a.  Suggestions to upgrade Wi

  • Microsoft FIX IT search for printer troubleshooting.

    WHERE DID THIS HELP ON THIS SITE FOR MY QUESTION?  (URL please)

  • Problems of mismatch paper HP Officejet 4500 Wireless

    Hey! I really hope you can help! I have a HP Officejet 4500 Wireless printer connected via my router wireless running on Windows Vista and it will not copy correctly. When I put something on the glass to copy, it says "Error" wrong paper size. Load d