Need to remove sixth and remaining characters from a PDF file name

Typical file name:
1925a - SomeotherTextHere.pdf
Need to remove everything after and including the "-" symbol or the sixth position.
I've tried this but to no avail:
var filePath = this.path.replace(this.documentFileName,"");
var newFileName = this.documentFileName.substring(0,6);
this.saveAs(filePath + newFileName);
Thanks in advance,
Russell

You were right......but a quick question. Why does this work without it? Thanks again!!!
var filePath = this.path.replace(this.documentFileName,"");
var newFileName = this.documentFileName.substring(1);
this.saveAs(filePath + newFileName);

Similar Messages

  • Remove spaces and special characters from a form field

    Hi,
    I am tragically new to all of this, but am trying to create a form in Adobe Acrobat 9.  I am trying to use a Custom Format script to take inputs in a form field and automatically remove spaces and special characters (hyphens specifically).  For example, if a user inputs "RAN-99 06" I would like it to change to "RAN9906."  I found this script that will not let users input special characters
    if (!event.willCommit) {
        event.change = event.change.replace(/[\$#~%\*\*\^\-\(\)\+=\[\]\{\};\"\<\>\?\|\\\!]/g, "");
    And that's okay, but I can't figure out how to disallow spaces.  Also, the perference would be for a script to allow users to input the data as they like, but to clean it up after they leave the text field.
    Thanks in advance!

    From the description, I assume that the script is currently in the Keystroke event. In fact, that would be a most logical way to have it; simply ignore anything unwanted when entered.
    If you want to allow the user to enter anything, but "clean it up" when done, you would place your code in the Validate event. You will have to adjust your Regular Expression so that it works globally, but that's the whole difference. This will change the value.
    Note that you can also enter the code into the Format event. However, that would only change the visual representation of the value, but internally, the value would remain as entered.
    Hope this can help.
    Max Wyss.

  • How do I remove spaces and special characters from the file name during rendering?

    I understand that I can set LR_renamingTokensOn to true, but I would like to replace all spaces in the file name with an underscore and remove characters not in the range A-Z and 0-9. What's the easiest way to achieve this?

    local photo = catalog:getTargetPhoto()
    local sesn = LrExportSession {
        photosToExport = { photo },
        exportSettings = {
            -- ... (determine from export preset) - whatev you want, just be sure you set export directory: LR_export_destinationPathPrefix
            LR_tokens = "{{custom_token}}",
            LR_tokenCustomString = LrPathUtils.removeExtension( photo:getFormattedMetadata( 'fileName' ) ):gsub( "[ %c]", "" ) -- remove spaces and control characters
    sesn:doExportOnNewTask()

  • Need to remove photshop and elements 8 from this old win xp computer and install it on new computer. I have the hard copy of the program, howeve registration here may prevent me from re-installing

    how can I remove photoshop and elements 8 from this older computer and install on new computer when it arrives

    You uninstall using the Windows control panel, and you install the same way you did on your old computer... put the disc in the drive and follow the onscreen instructions
    Also, unless you are asking about CLOUD programs, you will do better in the specific program forums
    Photoshop General Discussion
    Community: Premiere Elements | Adobe Community
    Photoshop Elements Forum http://forums.adobe.com/community/photoshop_elements

  • Need to pre-populate and Extract data from static PDF form

    Hi Jasmin or Jayan or anyone else that can answer.
    I have a requirement to use Digital Signatures.  Because of that, the forms must be static PDFs and the form variables will be “document form”.  I want to pre-populate the form via an SQL query and custom render process and render it as PDF so that the submitter can apply a digital signature when he/she is done and ready to submit for approvalSubsequent approvers will also digitally sign the form.  I know that I will specify the custom render to render only once and thereby preserve the signature(s) on the form.  I do, however, need to extract data from the form to control the business process.  I cannot access the data in the form the same way I do with an xdp and I also cannot pre-populate the same way I do with an xdp. 
    Any suggestions on how to attack this?

    Parth, one problem with your approach is he will submit PDF and therefore you won't be able to put the PDF in a variable that's suppose to contain just xml.
    The prepopulation should be the same. If you start off with an xdp, then you will call a render service that merges data with your xdp to create a PDF.
    Now when you submit, you will submit the entire PDF back in the Document Form variable. In Workbench, you can use the FormDataIntegration service to extract data from that PDF that's being stored under Document Form var/object/document and put it in an xml variable. Then you can just use xPath to do your condition.
    I'm assuming you'll just pass that same Document Form variable to the next step, because if you do any change to the PDF it'll brake the signature.
    Let me know if I missed anything.
    Jasmin

  • Strange-shaped fonts and unreadable characters in the PDF file

    Hello,
    A colleague of mine printed out a PDF file that I generated. Some of the fonts in the printed PDF file appear out-of-shape (slightly squiggly but still readable). These fonts are in plain body text and some of the heading styles. In addition, unreadable characters appear for fonts in the PDF where a keyboard input character format was specified in the source (in Framemaker a different character format can be specified for individual words within a paragraph format).
    He printed this PDF file a total of eight times. For the first five times there were no issues, but in the last three times the problems occured.
    He printed the files from the same printer and some of the printing was with the PCL profile, while others were with the PS profile.
    My colleague viewed the files using Adobe Reader 8 running on Windows XP.
    My PC is also Windows XP. The document source is FrameMaker 7.2. When generating the file, I used Acrobat Distiller 8.0. It is compatible with Acrobat 5.0 (PDF 1.0). The Acrobat Reader I have on my PC is Acrobat 8.0.
    Thanks,
    Ken

    I'm using acrobat 8.1.0 and I believe I have the same problem as Ken.
    However, I have a question. If the fonts simply weren't installed, wouldn't they also appear as weird characters when looking at a soft copy in acrobat? Why would the problem only occur when printing?

  • How do I copy and paste text from a pdf file and paste it into a new pdf or word file?

    I have a very large pdf file (500 pages) comprised of 200 letters.  How do I copy individual letters (copy and paste sections of the file) and put them in a new pdf or word file?
    Thank you

    Hi drredwood,
    When you open your PDF file a yellow bar will appear on the top of the screen.
    Click on 'Enable All Features'.
    Then you will be able to copy the content from your pdf and to paste in any of the file.
    Regards,
    Florence

  • How can i remove tool bar permanently in from my PDF file

    i am creating a web application, which will display adobe file. however i dont want to show any toolbar in browser. how can i achieve this? i want to make changes in my PDF file to happen this.

    @Thanks Pat.
    However in Acrobat XI, when move mouse over the document, toolbar pan is displaying, which help user to show toolbar window.
    is there anyway to hide below window in IE? (this pan is not showing in chrome)

  • Removing leading and trailing delimiters from a String

    I need to remove leading and trailing delimiters from a String like if my string is 111,112, then it should get changed to 111,112.Any idea how to do this??

    for my suggestion:String s = "111,112,";
    int begin = 0;
    while (!Character.isLetterOrDigit(s.charAt(begin)))
         begin++;
    int end = s.length() - 1;
    while (!Character.isLetterOrDigit(s.charAt(end)))
         end--;
    String news = s.substring(begin, end + 1);Of course, you'll have to clean it up a bit.

  • How to extract text from a PDF file?

    Hello Suners,
    i need to know how to extract text from a pdf file?
    does anyone know what is the character encoding in pdf file, when i use an input stream to read the file it gives encrypted characters not the original text in the file.
    is there any procedures i should do while reading a pdf file,
    File f=new File("D:/File.pdf");
                   FileReader fr=new FileReader(f);
                   BufferedReader br=new BufferedReader(fr);
                   String s=br.readLine();any help will be deeply appreciated.

    jverd wrote:
    First, you set i once, and then loop without ever changing it. So your loop body will execute either 0 times or infinitely many times, writing the same byte every time. Actually, maybe it'll execute once and then throw an ArrayIndexOutOfBoundsException. That's basic java looping, and you're going to need a firm grip on that before you try to do anything as advanced as PDF reading. the case.oops you are absolutely right that was a silly mistake to forget that,
    Second, what do the docs for getPageContent say? Do they say that it simply gives you the text on the page as if the thing were a simple text doc? I'd be surprised if that's the case.getPageContent return array of bytes so the question will be:
    how to get text from this array? i was thinking of :
        private void jButton1_actionPerformed(ActionEvent e) {
            PdfReader read;
            StringBuffer buff=new StringBuffer();
            try {
                read = new PdfReader("d:/getjobid2727.pdf");
                read.getMetaData();
                byte[] data=read.getPageContent(1);
                int i=0;
                while(i>-1){ 
                    buff.append(data);
    i++;
    String str=buff.toString();
    FileOutputStream fos = new FileOutputStream("D:/test.txt");
    Writer out = new OutputStreamWriter(fos, "UTF8");
    out.write(str);
    out.close();
    read.close();
    } catch (Exception f) {
    f.printStackTrace();
    "D:/test.txt"  hasn't been created!! when i ran the program,
    is my steps right?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I need my application to be able to open a .pdf file which was previously synced to the iBooks PFDs Collection. I then wish to remove the file from the collection and send it to email.

    I need my application to be able to open a .pdf file which was previously synced to the iBooks PFDs Collection. I then wish to remove the file from the collection and send it to email.

    I opened one of the PDF files in notepad and these are the first couple lines:
    瀖ᕁމጿ␠씴豈䧉筩롈ꓳ劏ꎯ僪뚢頟뻏즏谀㿃夑퀉꟠鲲쮂⫉笿褡밤籞冁탁ӓ轸뿐笼ⵆ횰䄌ඁ淥ة寨闤⬅鳦팥링빨嬄敎უ婏㣴ً鮓ࣿꢚ㑀녲莒඼ိȆ䕇纍쉉籶뺝갞伐쮠᥏﯒넉釖ȓ겴☧ ἣ秵駻�䣞띰㖔流羀籔朼敨ꢉ糶당⬤俉膇䄐惡�ಹꛖ鍡恡ⱶᶜ�堷﹑ﱌ僿걄뎔æ䋷귪⛢⫐䅪䉙὿烶ꖆ႟ᗔ瘞狻틫儩六잶覱낵듘盋崾�ᦜ㺆௹뻹燴ឋ騙쬄ꏿ뽒煹�钼뇲腎稦ꃲ㈃沒ꔈ뺐뛽첑䘶畱䍣紻 ⁜哠鳾

  • Need to Remove the tabs group Title from browser window title

    When I use a saved tab group, which means I named that tab group in FF 5,''' the name of the tab group appears at the top of the browser along with the title of the web page I am viewing'''. Not good, I need to remove that tab group title from the browser window title, so I am only seeing the title of the webpage, and nothing from the tab group. How do I do that?
    thanks
    JSC

    You can add the site to the Pop-up Blocker Exceptions list in Options > Content > Block Pop-up Windows > Exceptions
    *See --> [https://support.mozilla.com/en-US/kb/Pop-up%20blocker#w_pop-up-blocker-settings Pop-up blocker-Pop-up blocker settings]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Remove all non-number characters from a string

    hi
    How i can remove all non-number characters from a column ? for example , i have a column that contains data like
    'sd3456'
    'gfg87s989'
    '45/45fgfg'
    '4354-df4456'
    and i want to convert it to
    '3456'
    '87989'
    '4545'
    '43544456'
    thx in adv

    Or in 9i,
    Something like this ->
    satyaki>
    satyaki>with vat
      2  as
      3    (
      4      select 'sd3456' cola from dual
      5      union all
      6      select 'gfg87s989' from dual
      7      union all
      8      select '45/45fgfg' from dual
      9      union all
    10      select '4354-df4456' from dual
    11    )
    12  select translate(cola,'abcdefghijklmnopqrstuvwxyz-/*#$%^&@()/?,<>;:{}[]|\`"',' ') res
    13  from vat;
    RES
    3456
    87989
    4545
    43544456
    Elapsed: 00:00:00.00
    satyaki>
    {code}
    I checked this with minimum test cases. It will be better if you checked it with other cases.
    Regards.
    Satyaki De.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Removing the Control Characters from a text file

    Hi,
    I am using the java.util.regex.* package to removing the control characters from a text file. I got below programming from the java.sun site.
    I am able to successfully compile the file and the when I try to run the file I got the error as
    ------------------------------------------------------------------------D:\Debi\datamigration>java Control
    Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repet
    ition
    {cntrl}
    at java.util.regex.Pattern.error(Pattern.java:1472)
    at java.util.regex.Pattern.closure(Pattern.java:2473)
    at java.util.regex.Pattern.sequence(Pattern.java:1597)
    at java.util.regex.Pattern.expr(Pattern.java:1489)
    at java.util.regex.Pattern.compile(Pattern.java:1257)
    at java.util.regex.Pattern.<init>(Pattern.java:1013)
    at java.util.regex.Pattern.compile(Pattern.java:760)
    at Control.main(Control.java:24)
    Please help me on this issue.
    Thanks&Regards
    Debi
    import java.util.regex.*;
    import java.io.*;
    public class Control {
    public static void main(String[] args)
    throws Exception {
    //Create a file object with the file name
    //in the argument:
    File fin = new File("fileName1");
    File fout = new File("fileName2");
    //Open and input and output stream
    FileInputStream fis =
    new FileInputStream(fin);
    FileOutputStream fos =
    new FileOutputStream(fout);
    BufferedReader in = new BufferedReader(
    new InputStreamReader(fis));
    BufferedWriter out = new BufferedWriter(
    new OutputStreamWriter(fos));
         // The pattern matches control characters
    Pattern p = Pattern.compile("{cntrl}");
    Matcher m = p.matcher("");
    String aLine = null;
    while((aLine = in.readLine()) != null) {
    m.reset(aLine);
    //Replaces control characters with an empty
    //string.
    String result = m.replaceAll("");
    out.write(result);
    out.newLine();
    in.close();
    out.close();

    Hi,
    I used the code below with the \p, but I didn't able to complie the file. It gave me an
    D:\Debi\datamigration>javac Control.java
    Control.java:24: illegal escape character
    Pattern p = Pattern.compile("\p{cntrl}");
    ^
    1 error
    Please help me on this issue.
    Thanks&Regards
    Debi
    // The pattern matches control characters
    Pattern p = Pattern.compile("\p{cntrl}");
    Matcher m = p.matcher("");
    String aLine = null;

  • Removing non printable characters from an excel file using powershell

    Hello,
    anyone know how to remove non printable characters from an excel file using powershell?
    thanks,
    jose.

    To add - Excel is a binary file.  It cannot be managed via external methods easily.  You can write a macro that can do this.  Post in the Excel forum and explain what you are seeing and get the MVPs there to show you how to use the macro facility
    to edit cells.  Outside of cell text "unprintable" characters are a normal part of Excel.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • SSO from CRM 2007 to ITS of R/3 4.7.

    Hi Experts, We are using CRM 2007 interaction center. We have provided some links to R/3 transaction using transaction launcher. Now we need to implement SSO to the R/3 system. We are using Standalone ITS 6.20 system to connect to R/3 from Interactio

  • Save File on Local PC

    Hi, Is it possible to save the output of a JSP file in .csv format? I do not want to force the user to click on save. Once the user clicks on submit, I would like to display the page and also save the file (file.csv) on their computer (i.e. c:\temp\J

  • Dialog Boxes

    I'm trying to decide whether to convert from Visual Basic to Dreamweaver for content (and ultimately, website development).   Does DW have a dialog box feature or some capability to open a Microsoft Word or Excel file? (the actual file, not just the

  • JDAPI - method getAttachedLibraries does not get all attached libraries

    Hello, i've a strange behavior while using JDAPI to list all Libraries attached to forms. I've the following code: Jdapi.startup(true, true, true); String startModule = new String("c:\\test.fmb"); FormModule fmd = FormModule.open(startModule); System

  • How do I restore deleted videos from my iPad?

    I accidentally deleted some videos on my iPad that I was using in an iMovie, an it removed them from there as well. Can I recover those videos?