Out-file to a line not the end

Hi guys,
I have a script problem I'm trying to resolve. I want it so that a user can edit a single line of a txt tile. Is this possible using the out-file command?
"out-file 'C:\temp.txt' -append -inputobject $user_input"
This will add the line to the end of the file, but that's not what I want it do. Suppose I have a text file that looks like this.
1.Hello
2. Dad
3. Mum
and I want to edit it so hello is now bye. Why can't i just do:
"out-file 'C:\temp.txt'[0] -append -inputobject $user_input"
When I run this nothing happens. Any ideas?

The heading and content description is little confusing
are you looking for code which write on top of the line
Eg:
Line1 - This is user input value
Line2
Line3
$content = Get-Content C:\Temp\See.txt
$userinput = Read-Host 'User Value'
$userinput | Set-Content C:\Temp\See.txt
$content | Add-Content C:\Temp\See.txt
Note: As
Gareth Fletcher<abbr
class="affil"></abbr> suggested it's not possible using Out-File
If you want to replace as you mentioned in description you can use Venu's code
Regards Chen V [MCTS SharePoint 2010]

Similar Messages

  • How to add a new line at the end of eTEXT file

    Hi,
    I have modified the RTF template for the R12.1.3 Positive Pay File report (IBYPOS_PAY_en.rtf). Everything is good, except that the bank requires a "T" (Capital T) character in a new line at the end of the text file. Has any of you came across this before? How do I modify the template to achieve this?
    Thank you,
    Sinan Topuz

    I believe this is related to BI Publisher. Any comments would be greatly appreciated.
    Thanks,
    Sinan

  • File Adapter Write Operation inserts a new line at the end

    Hi,
    I am using the write operation in the File Adapter from BPEL Process. The data is written successfully to the file and file is also created in the location specified in the adapter wsdl. But in the file created, it creates a new line at the end of the file. This new line has to be avoided when writing data to a file.
    Has anyone faced this and solved this ?
    I am SOA 10.1.3.4.
    Cheers,
    - AR

    It is a bug in 10g and will be resolved in one of the versions of 11g.
    Cheers,
    -AR

  • How to draw horizontal line at the end of table for multiple line items

    Dear Experts,
                       Pls can anyone help me how to draw horizontal line at the end of table for multiple line items . kindly help me regarding this
    Thanks
    Ramesh Manoharan

    Hi
       I tried as per your logic but it is not solving my problem .  when i am gone to table painter it is showing line type 1 and line type 2
      is below format.. if u see here line type 1 bottom line and line type 2 top line both are same..  so how to avoid this ?
                              line type 1
                             line type 2

  • Empty line at the end of  SAP Java instance profile

    I saw this today in help.sap.com, which says that an Java instance profile must have an empty line at the end of the file, would anyone know what is it for ?
    The instance profile (/usr/sap/<SID>/SYS/profile/<SID>_<instance name>_<hostname>) u2013 this file contains settings that apply to the instance as a whole. For a Java-only installation, the file can be edited with any text editor (beware that the file must have an empty line at the end.);
    http://help.sap.com/saphelp_nw04s/helpdata/en/2e/611724f410254ca12a3f396ec5ae85/frameset.htm
    thank you
    Jonu Joy

    I have heard many "explanations" for this, but never really any solid answers.
    From experience, however, I can tell you that the SAP profiles (both ABAP and Java) will miss the last parameter if it is located on the bottom line of the file.  I have always put in two or three blank spaces at the bottom of the profiles in order to avoid this.

  • Line at the end of repeat subform

    Hi Adobe experts,
    I have got a situation where in the item table is a subform which i have made it with repeat subform
    The columns of the item table are drawn by lines.
    So for every line item,the horizontal line at the end of the table appears when the subform repeats.
    I do not want the line to appear at the end of line item but only at the end of a page..
    Is it possible to do so ? or we should change the design by using insert table
    Please let me know your suggestions.
    Thanks in advance
    Regards,
    Gowthami SK

    Hello Varun,
    The line is in the end of the subform ( Placed down ),the subform only is for the item table ,so if the line is in the subform ,as the items repeat,the line also gets repeated
    I want the line only at the end of each page when the items get filled
    Regards,
    Gowthami SK

  • Printing a Line at the end of a Repeating Frame in Reports 6/6i

    Hi Folks,
         In few of my designed reports I want a horizontal boiler plate line drawn at the end of the repeating frame on each page. The Number of Records property of the repeating frame is set to 0, i.e., depending upon the margin allocated on each page the report should fetch as many records as they can fit in the allocated area of the frame. I have also set the Page Protect property of the repeating frame to Yes, since we want the description of the records to be displayed fully on each page i.e., a record displayed last on a page should have its description on one page and it should not go to the next subsequent page. Now when I draw a horizontal boiler plate line at the end of the repeating frame in the Layout Model and set its property to Print on all Pages, the line in few pages of the report does not print at all and on the rest of the pages it is displayed at its correct position. I have even tried using an Anchor but it still does not work. Do I need to set the property of the anchor or am I missing some basic point here?
    TIA
    Hassan

    Hi there,
    I have tried that but when the records are less in number on a page i.e., 1-2 then the line do prints on each page but there is a gap between the line and the last record.I want that the line should print right after the last record. Should I use an anchor here? But we cannot use an anchor between a line and the margin.
    Any ideas??

  • SMS Messaging: Blank line at the end of the message

    I never had this problem with the 3G, but on my iPhone 4, I often see a blank line at the end of my text message after I send it.
    Also, a similar issue I am having is that while I am drafting text messages, the words fits nicely in the text input box, but once I hit send, some words are shifted to the next line.
    *Typed in input box:*
    Sorry. We'll be there asap.
    *Show in the green bubble:*
    Sorry. We'll be there
    asap.
    Anyone know how I can solve this problem? Thank you!

    this isnt the way to respond to someones problem... thats not what this forum is for ..
    now to the op have you tried resetting your phone by holding both the home button and the sleep/wake switch for 15 seconds...
    if that doesnt work I would try restoring your phone from backup to see if you can clear this issue up

  • My new version of Firefox (downloaded automatically) on my Mac displays long paragraphs in emails as a single line, so the end of the paragraph is off the screen. How can I make it automatically wrap to fit the screen?

    Long paragraphs in incoming emails display as a single line, with the end of the paragraph running off the screen. I want to make it wrap automatically to fit the screen.

    For the browser window, just drag it to the top left of the screen (click and hold on the top bar with the traffic lights to drag), then in the bottom right of the window you'll see a rectangle with diagonal hatching. Click and hold on that and drag the window to the size you want.
    Clicking on the green dot at top left will expand the window to fit the screen, clicking it again will shrink it back to where it was (this doesn't work in Finder windows quite the same).
    The menu bar size is set in the bowels of the OS, though there may be third-party applications which can alter it.
    As it's size is relative to the screen resolution, you could try reducing the resolution in System Preferences > Displays to see if that would suit you better.

  • How to show an empty line at the end of a ParagraphView

    Hi everybody,
    I wonder if anyone knows how to extend ParagraphView to show an empty line at the end of every paragraph?
    Thanks in advance,
    mrai

    I tried to use that class and couldn't get it to work.
    JTextField field = new JTextField();
    field.setText("blah blah");
    CompisiteView view = new ParagraphView(field.getDocument().getRootElement());
    int views = view.getViewCount() //always zero...

  • Horizontal line at the end of page within for each

    I try to do the following with PO :
    When a PO lines take several page to print I want to draw a line at the end of the page.
    <xsl:for-each select=".//LINES_ROW" xdofo:ctx="3" >
    <fo:table-row keep-with-next.within-page="always" keep-together = "always" xdofo:repeat="R">
    <fo:table-cell keep-together="always" xdofo:use-attribute-sets="lc_4" >
    <fo:block xdofo:use-attribute-sets="lb_2 lb_5">
    <fo:inline id="Text12{$_XDOFOPOS}"/>
    <fo:inline id="Text10{$_XDOFOPOS}"/>
    <fo:inline id="Text11{$_XDOFOPOS}"/>
    <fo:inline id="Text5{$_XDOFOPOS}"/>
    <fo:inline xdofo:use-attribute-sets="li_1">
    <xsl:value-of select=".//ITEM_DESCRIPTION" xdofo:field-name="ITEM_DESCRIPTION"/>
    </fo:inline>
    >
    </fo:table-row>
    </xsl:for-each>
    Now when i reach the end of a page I can't draw a line is there a way to draw an horizontal line ?
    Thanks for the quick answer

    Did you ever get an answer to this? I have the same question.

  • I am trying to sync my Ipad 2 to my Itunes account on my laptop.  It will only sync my purchased music.  All of my personal CD music that is on the account is grayed out with a red circle at the end.  Please help.

    I am trying to sync my Ipad 2 to my Itunes account on my laptop.  It will only sync my purchased music.  All of my personal CD music that is on the account is grayed out with a red circle at the end.  Please help.

    Did you select all of the music to sync by clicking on the playlists or albums or whatever you use in iTunes - in order for them to sync? Or did you click on Entire Music Library if you want all of your music on the iPad?

  • When printing from aperture my margins are unequal, even if i set my margins they come out bigger one side  and not the other. i am using a macbook pro running osx lion and printing with a canon pro 9000

    when printing from aperture my margins are unequal, even if i set my margins they come out bigger one side  and not the other. i am using a macbook pro running osx lion and printing with a canon pro 9000.
    please can anbody help or advise?

    You didn't mention any color calibration being done on your monitor.  This is an essential part of any color-correct workflow.  What are you using to calibrate your monitor (and your printer)?
    Print profiles (for soft-proofing as well as printing) are for specific combinations of paper & printer.  The nine you have are each, most likely, for a common paper (perhaps mfr'd by Canon) to be used with your printer.
    I don't know what you mean when you say "I choose a high standard print option".
    Have you read the User Manual chapter on printing?
    Printing Your Images
    There is also a good appendix on calibration:
    Calibrating Your Aperture System

  • Audio problem: large avi file / audio out of sync getting worse towards the end

    Hi,
    We have an 11 hours avi file (about 500GB) that plays fine in Windows Media Player and is in sync.
    When we import it into Premiere Pro CS6 audio and video tracks are of the same length. At the beginning of the video sound is fine and in sync as well. But at the end of the video the audio is out of sync by a couple of frames (but still the same length). We tried different things and the only thing that worked was setting the audio buffer size to maximum. Now the audio is in sync at the beginning, middle and end of video. But of course editing is impossible like this (if you hit pause the audio needs some time to stop).
    Any help or suggestions are welcome.
    Cheers

    AVI is a wrapper... what is inside YOUR wrapper?
    Codec & Format information, with 2 links inside for you to read http://forums.adobe.com/thread/1270588
    Report back with the codec details of your file, use the programs below... A screen shot works well to SHOW people what you are doing
    http://forums.adobe.com/thread/592070?tstart=30 for screen shot instructions
    Free programs to get file information for PC/Mac http://mediaarea.net/en/MediaInfo/Download
    Also, When your project sequence is correct, you will not see a red line over your timeline at first import, before you do anything to the video
    http://blogs.adobe.com/premiereprotraining/2011/02/red-yellow-and-green-render-bars.html
    If you have a red line over the timeline after importing a video and before adding any effects... your project is wrong for your video
    The NEW ITEM process will ensure that your sequence matches your video file
    CS5-thru-CC PPro/Encore tutorial list http://forums.adobe.com/thread/1448923 has a link to learn about the NEW ITEM process
    Now that you have your video DETAILS available, check to see if you have a video file with a Variable FRAME Rate
    IF YES, you will most likely need to find a program to convert to a CONSTANT Frame Rate to edit in Premiere Elements

  • Extra line at the end of file when transferred from XI to FTP.

    Hi All,
    Need help regarding the below query.
    I have an inbound structure with the below format
    MT_RAVE_L                     1..1 (is the main node)
          Logistic Info                 1..Unbounded (this is the structure under the main node)
                   LOGSOPTUN      1..1 (this is below Logistic Info field)
          File_Name                   1..1 ( This is also below main node with the same level of Logistic   Info structure)
    (Tried to insert a pic of the mapping but was unsuccesful)
    We are trying to move a file from XI to FTP. the file is being created in FTP succesfully but an extra blank line is being inserted at the end of the file.
    After lot of investigation we could trace the it is because of the File_Name field data is being not moved to inbound file.( Here we are using the File_Name field data for creating a file name in FTP. i.e., the File_Name is the File name under which our data is being stored in FTP and that is the reason we are not using File_Name in Content Conversion)
    Can you please suggest ways so that the empty line is not created.
    Thanks in advance
    LRK.

    Hello,
    Have you set the property in  File adapter lastFieldOptional.
    Thanks and Regards
    Hemant

Maybe you are looking for

  • Data is not getting posted to R/3 from CRM

    Hi to All, When i am creating sales order in CRM data is not getting replicated to R/3. System is showing that B Doc is created , posted and validated. But here in CRM system outbound queue is generated but in R/3 there is no data in inbound queue. C

  • How to close automatically sales order with open items ?

    Hi, There is a request from a client: he would like to be able to close the open items of a sales order which are not billed automatically according to a specific calendar. Moreover he would like to specify that ,generally speaking, the customer does

  • Aperture = iPhoto + Bridge Photo Downloader + Photoshop?

    I am considering to use Aperture to streamline my workflow but I wonder about its file management capability. Let me explain the details: I love iPhoto to browse, find and preview photos. It provides the most intuitive, easy and fast way for that. Th

  • It must be simple. Problem with a locked text, layer, or who knows what

    Ok, so I'm a newbie with Indesign. The guy who was helping me with indesign here at my company is on vacations and overseas. I just can't call him to ask this. It's pretty simple. I am editing a newsletter, I took the old template to use as a base fo

  • IS POSSIBLE USE 'IF' IN QUERY WITH DB ACCESS?

    Hi, I'd like to use: SELECT IF(send = 1, 'YES', 'NO') FROM post to take records from a dbaccess. I used it but I have this proble ... "Function IF not definited" Can I use IF with dbaccess? Thanks