How to remove only the first .Period in a file name using CL.

Hello!
So, I've used code similar to this before to remove special characters.  It works for a period . as well, but, of course removes ALL periods.
file=/Users/niles/Desktop/.test.txt; echo $file"${file//[\\.]/}"
How do get a reult that only remove the first period . and leaves the rest?
Thanks!!

touch .test.txt .t.e.s.t.t.x.t
# Test it.
$ for FILE in .test.txt .t.e.s.t.t.x.t
do
echo ${FILE} `echo ${FILE} | sed -n 's/^.//p'`
done
.test.txt test.txt
.t.e.s.t.t.x.t t.e.s.t.t.x.t
# then change the filename.
$ for FILE in .test.txt .t.e.s.t.t.x.t
do
mv ${FILE} `echo ${FILE} | sed -n 's/^.//p'`
done
$ ls -l t*
-rw-r--r--  1 andya  501  0 Apr 23 21:32 t.e.s.t.t.x.t
-rw-r--r--  1 andya  501  0 Apr 23 21:32 test.txt

Similar Messages

  • How to get only the first result in extract function

    do you know how to get only the first element of the function extract.
    v_result := p_response.doc.extract('//'||p_name||'/child::text()').getstringval();
    if i have 5 responses like '100','100',100','200','200' e get '100100100200200' and i want only '100'.
    thanks in advance

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • Apparently I inadverdently clicked on something that changed my address book listings to showing only the first three letters of each name -

    the column showing my address book now shows only the first three characters of each name
    it's like they have all been abbreviated
    I have to try and decipher the name from those three characters before clicking
    to see the
    person's address window with the full information
    I would like to be able to read the entire name- first & last like before
    Thank you in advance

    try dragging the column heading to make the column wider

  • How to rename the SharePoint Document Library existing file name using Web service

    Hi,
    How to rename the SharePoint Document Library existing file name using SharePoint Web service.
    Is it possible. How could i do it?
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Lists.UpdateListItems Method
    would be helpful for your requirement.
    Here is a blog with code demo for your reference:
    http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to remove only the last element of spreadsheet string

    I use path to string option to store image path into database and while retrieving the string is again converted into path but it gives out an error as the output of array to spreadsheet string gives out a tab at the end which is unable for the IMAQ read file to recognise.but when i use the path of the image directly into IMAQ readfile the image is opened . so how to remove the tab only at the end of output of the spreadsheet string(whose length can vary)? I have also attached my program with this.
    Attachments:
    retrieve_images_from_DB.vi ‏65 KB
    file_path_to_db_(images).vi ‏40 KB
    create_table_for_images.vi ‏45 KB

    indhu wrote:
    > Thanks for your reply!
    > But my problem is to remove only the last element(which is a tab or an
    > alphabet) from a spreadsheet string of any length.
    If you just want to remove the last character of a string just use the
    String Size function reduce the result by one and wire it together with
    the string to the Split String function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to get only the first level of nodes for a subform?

    How can we get only the first level of nodes of a subform?
    For ex:
    Form1
         SubForm1
              Text1
              Text2
              RadioButton1
         SubForm2
              Text1
              Text2
              RadioButton1
         SubForm3
              Text1
              Text2
                   SubForm31
                        RadioButton1
    In this heirarchy if we give Form1.nodes will refer to all nodes under the Form1 (SubForm1,Test1,Text2,RadioButton1,SubForm2,...SubForm31, RadioButton1 etc..)
    But is there any way that we can access only the first level of nodes of Form1 ie can we get only (SubForm1,SubForm2,SubForm3) for Form1 in any Way..?
    Thanks.

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to replace only the first specified character in a string and leave other occurrence of the character alone.

    Hello my Friends:
    I have a string that looks like this in a column:
    Hello, World, Hello, Planet
    I want to replace only the first occurrence so that the result looks like this:
    Hello World, Hello, Planet
    Working on some bad data source.
    I need to replace the character regardless of it's location as long as it is the first.
    I tried something like this, but I soon discovered that if the comma or character is missing the the string may get truncated or altered. If there are no characters in the string, then I want to simply leave it alone.
    Here is where I am at:
    DECLARE @MyValue NVARCHAR(MAX) = 'Hello, World, Hello, Planet';
    SELECT MyString = STUFF('Hello, World', CHARINDEX(',', @MyValue, 0), 1, ' ');
    Thanks my friends.

    I have a string that looks like this in a column:
    Hello, World, Hello, Planet
    Why doesn't it say Hello Kitty?
    Oh, sorry about that. Anyway:
    SELECT MyString = CASE WHEN CHARINDEX(',', @MyValue, 0) >= 1
                           THEN STUFF(MyString, CHARINDEX(',', @MyValue, 0), 1, ' ')
                           ELSE MyString
                     END;
    Erland Sommarskog, SQL Server MVP, [email protected]
    Erland, love you sense of humor!! :)
    Thanks for the solution.

  • How to return only the first string

    Hi Guys,
    I have a mapping where I am creating a filename from data in within my data file, I am using one of my variables i.e. Account
    The data looks like this
    Account:
    123
    123
    123
    456
    456
    456
    789
    789
    789
    What I want is to is return only the first row u201C123" and concatenate it with a constant to make up the filename.
    Any help will be appreciated.
    Kind Regards,
    CJ Bester

    very simple
    use copy value standard function like below.
    Account------->copyvalue(0)----------->
                                                                      CONCAT------------->TARGET
                                         Constant------->
    Regards,
    Raj

  • How to map only the first occurance to the op in graphical mapping

    Hi,
    i have a record whose occurance is ' * '.But to the output i need to only map the value of the field which comes in the first occurance of the record.Can anyone help me in this.its very urgent.
    For ex :
    my input is
    <header>
    <inp1>123</inp1>
    <inp2>hello</inp1>
    </header>
    <header>
    <inp1>456</inp1>
    <inp2>hello</inp1>
    </header>
    To the output field <op1> i have to Map ' inp1 ' field but it has to take the value of the first inp1 i.e "123" only always.Any help on how to do this.
    Thanks in advance,
    Bhargav
    Message was edited by:
            bhargav gundabolu

    Hi Raj,
    My inp structure is:
    <header>
    <inp1>123</inp1>
    <inp2>hello</inp1>
    </header>
    <header>
    <inp1>456</inp1>
    <inp2>hello</inp1>
    </header>
    This has to me mapped to the output structure
    <result>
    </op1>
    </result>
    After Mapping inp1 to op1 my structure should appear as
    <result>
    <op1>123</op1>
    </result>
    <result>
    <op1>123</op1>
    </result>
    where <Header> node is mapped to </result>.As <result> has to appear as many times as Header appears.But the <op1> value has to be same as that of the <inp1> of the first <Header>

  • How to populate only the first record by default when the page opens?

    Dear Members,
    I am using OAF R12 and my requirement is as follows:-
    When the user opens the custom OAF R12 page, I just want to query the first record from the underlying VO.
    For example, If the table has 10 rows, I just want to query the first row as soon as the page opens.
    I have written the below code:-
    Process Request Method of the CO:-_
    am.invokeMethod("initHeaders");
    Code in AM_
    public void initHeaders()
    HeadersVOImpl hVO = getHeadersVO1();
    hVO.initQueryHeaders();
    Code in VO_
    public void initQueryHeaders()
    executeQuery();
    As it is very clear that with the above code all the records will be queried. I have to add something before the executeQuery() method in the VO to just query the first record.
    Can any one please help me by guiding me what I should add before the executeQuery() method in the VO?
    Many thanks in advance.
    Regards,
    R4S.

    Hello Gyan,
    Many thanks for your reply.
    The below line in your code is throwing incompatible type error:
    OARow row = vo.first();
    Can you please help me.
    Regards,
    R4S

  • How to replace first letters of a file name using Power shell or CMD

    Hi guys i am having a problem on mane files that i have which are duplicated. The main reason i cant group them by name is because they have numbers in front of their name which differs Eg
    01 - fileName.txt
    09 - fileName.txt
    02 - fileName.txt
    11 - fileName.txt
    i have a shed loads of them and would like to rename them by deleting the first three characters if they are numbers. I managed to create a powershell script to do that but the problem was that it would not work properly because the file would have a duplicated
    name after deleting the first few chars.
    can anyone help with a better script which would add a number to the end of the file name eg:
    fileName1.txt
    fileName2.txt
    fileName3.txt
    Ps all the files start with two numbers followed by a dash, however i have manually done a few which does not start with numbers and should be left alone by the script
    Thank you

    Here's a quick way to do it. I'm not sure what your existing code looks like but it sounds like you could incorporate this line into it.
    if ($oldfilename -match "[0-9]")
    $newfilename = $oldfilename.split("-")[1].trim().split(".")[0] + $oldfilename.split("-")[0].trim() + "." + $oldfilename.split("-")[1].trim().split(".")[1]
    else
    $newfilename = $oldfilename
    01 - fileName.txt becomes fileName01.txt
    fileName.txt stays fileName.txt

  • How do I customizing the download pop up window file name?

    I have a site that streams a PDF. The file name is not included in the URL. When I set my options to Save As for Adobe I am presented with the Download pop up box, but there is no extension in the box so when I double click the item it asks what file to open it with. So my question is, is it possible to be able to customize the name of the file being saved rather then letting the browser determine the name based on the URL?

    A good solution, but I went one better -  I got rid of the HP Printer and bough an Epson.
    The problem no longer exists.

  • How can I extract only the audio as an aiff file?

    Using a Sony DSC-N2 Cybershot Camera I recorded video that was saved as “MOV01606.MPG”. The video plays back with sound in Quicktime Pro and iTunes but how can I extract only the audio as an aiff file?

    Use MPEG Streamclip (free) to convert your .mpg files to QuickTime formats.
    QuickTime can't extract audio from muxed file formats.

  • Lately when I do an images search only the first page actually shows the images- the rest show blank squares- why, and how do I fix it?

    Over the last week I have noticed more and more that my searches do not show up properly. Today only the first page of images actually show, the rest are blank spaces, but if I click they go to the image site. The rollover does not show either.
    What can cause this, and how do I fix it? I have tried various safe settings but this has no eefect at all.
    Thanks.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"

  • Only the first page is printed reduced as setup. All pages afterward are full size with information cut off. Recent problem. Can print from Safari just fine. How can I get all pages to be reduced size?

    Question
    Printing internet pages
    Reduced print size
    Only the first page is reduced and printed as desired
    All pages after the first page are full size with information cut off
    Recent problem never seen before
    Can print from Safari and other software just fine
    How can I get all pages to be reduced size?

    One suggestion worked from the Firefox prints incorrectly link mentioned above by mha007. I'm thrilled since this has been annoying me for weeks. Thanks mha007!
    Reset all Firefox printer settings
    # Open your profile folder:
    # On the menu bar, click on the Help menu and select Troubleshooting Information. The Troubleshooting Information tab will open.
    # Under the Application Basics section, click on Show in Finder. A window with your profile folder will open.
    # Note: If you are unable to open or use Firefox, follow the instructions in Finding your profile without opening Firefox.
    # On the menu bar, click on the Firefox menu and select Quit Firefox.
    # In your profile folder, copy the prefs.js file to another folder to make a backup of it.
    # Open the original prefs.js file in a text editor (such as TextEdit).
    # Remove all lines in prefs.js that start with print. and save the file.
    # If something goes wrong when you open Firefox, close it again and overwrite prefs.js with the backup you made.

Maybe you are looking for

  • Producer/Consumer Design Pattern + DAQmx + Event Structure

    Dear community users, at the moment I try to implement the Producer/Consumer Design Pattern into my current project. For this purpose I am trying to make a "minimal-example" in which I use the Producer/Consumer Design Pattern for the data acquisition

  • DVI/RTP packet decode

    Hi, I need to stream audio and/or video to a PDA device. There is a trick here which is: The PDA must receive the stream from a multicast address. For this I have implemented a Bridge application which joins the multicast group on behalf of the PDA a

  • Solaris 10 U4 and kernel patches

    When I install a fresh U4 machine, I then (as I always do) apply the recommended patch cluster. U4 has kernel patched to 120011-14. In the patch cluster, there are kernel patches 118833-36 and also 120011-14. When I run the patch cluster, it installs

  • Sequences in Palnning with mutiple Plan types

    Running on Planning 9.3.1, and having the Load Balancing structure. Trying to create a Sequence should run the Business rules, as each HBR should run on different Plan types. Surley I need to Merge the variables of RTPs. Is there any work around way.

  • Tax balance sheet Dep area in Asset Accounting

    Dear Sap Gurus, Can anyone tell me how to configure Depreciation area taxbalance sheet for india. Highly appreciated Tanks Manoj