Skip to content

XAware Open Source Data Integration

You are here: Home arrow Forums
XAware Community Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Replacing text with another text in a file. (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Replacing text with another text in a file.
#2940
prichards (User)
XAware user
Posts: 104
User Offline Click here to see the profile of this user
Re:Replacing text with another text in a file. 2 Months, 2 Weeks ago Karma: 13  
Please post new subjects to a new thread (topic) - this is unrelated to the date questions.

You should be able to create the first row as desired, using the File bizcomp (is the issue a header line? the File Bizcomp now has header line processing capability). If you are trying to make a copy of the first file (or edit an existing file) replacing the first line, you have a couple of options. The File BC provides read, write, and append operations (no update or indexing into a file).

You could write a Functoid that replaces the first line (input filename and newFirstLine - using java file operations).

You could also use the File Bizcomp to read the input file and a second File Bizcomp to write the output file. You can write the new first line, and then write out the existing content for the remaining lines. (You can use a xa:switch/xa:case to determine the first line based on some content or a line count assigned when you read the file in the first Bizcomp.) This is less effcient than the functoid approach because the file will be read into XML by the first Bizcomp and then the second Bizcomp will iterate over the XML to write out the new contents; but that may be sufficient depending on your performance requirements.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
      Topics Author Date
    thread link
How to get the date data from Oracle database
caoshuang 2008/07/29 06:24
    thread link
thread linkthread link Re:How to get the date data from Oracle database
prichards 2008/07/29 09:32
    thread link
thread linkthread linkthread link Re:How to get the date data from Oracle database
caoshuang 2008/07/29 19:35
    thread link
thread linkthread link Time format - 4:00PM
kotireddy 2008/10/01 07:56
    thread link
thread linkthread linkthread link Re:Time format - 4:00PM
dblack 2008/10/01 09:16
    thread link
thread linkthread linkthread linkthread link Re:Time format - 4:00PM
kotireddy 2008/10/01 23:41
    thread link
thread linkthread link Delete a file that is created by File BizComponent
kotireddy 2008/10/01 08:04
    thread link
thread linkthread linkthread link Re:Delete a file that is created by File BizComponent
dblack 2008/10/01 09:23
    emo
thread linkthread link Replacing text with another text in a file.
kotireddy 2008/10/20 07:11
    thread link
thread linkthread linkthread link Re:Replacing text with another text in a file.
prichards 2008/10/22 16:44
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Community Login

Polls

What best describes your current or next project that will include data services?
 

Visit XAware.com