Hi All,
Is there anyway to update a file text using an appengine.In the attachment text file,i need to erase the lines starting with "N1" and "PER" and update the number count in the line starting with "SE"(the number between the stars) and update the file.Im getting error while using Get Position and SetPosition. Any Help Appreciated..
Thanks,
Ashok K.
Attachment | Size |
---|---|
test1.txt | 896 bytes |
Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
To my knowledge , set position works only when file is opened in update mode. Are you opening the file in update mode.
Also, what is the error you are getting. rahulkhandelw is right, the file needs to be opened in a update mode.
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Hi Lepa and Rahul,
Thank you.. Yes now i opened it in Update Mode and now the file text is not updating properly and im getting only the latest text line read from the source file.Lastly, Thank you for your quick response..
Thanks,
Ashok K.
Hi Ashok,
I will try to write the program for u . It might take some time.
Hi Rahul,
Thank you so much..Meanwhile i will fight my best to make it.
Hey Ashok,
One quick question, Won't it would be a good idea to create a new file??
Hi Rahul,
Yes..You are right..Im making a copy of the source file.Sorry for the delay..
Thanks,
Ashok K.
One more thing make sure while opening the file charset is Non-Unicode.
&TestFile = GetFile("C:\Documents and Settings\rkhandelwal\Desktop\test.txt", "R", "A", %FilePath_Absolute);
Here parameter A specifies that file is being opened in Non-unicode char set. I used getposition method and I didn't encounter any error.
Please let me know if you face any problem.
Yes.Im near to the task.Now im succeeding when i have only one file to update.Suppose if i have 3 copies of source file each one with a difference in count of lines ,im able to get theoutput file with the result equal to that of the last file as
Foreg;
File name:1.txt
Count:2
Filename:2.txt
Count:2
Filename:3.txt
Count:2
Here the count of thelines starting with N,PER in all the 3 files are different.But im getting the result same for all the 3 files.
Thanks,
Ashok K.
I m confused now.. Are you creating only one file for all 3 files.. i hope No. Process all files in a serial way and make sure variables used are properly reassigned.
Hi Rahul,
Im just copying the source file to 3 files and making differences in 3 copied files each manually(like extra added line,number of line count starting with N,PER,etc)just to test it.Then run the appengine to erase those lines starting with N,PER and update the files.
Thanks,
Ashok K.
How are you erasing a line in file?
Hi Rahul,
Now,im taking these 3 filenames in an array, then using IF LOOP in FOR LOOP writing those files ommitting those lines(N,PER).
Thanks,
Ashok K.
ok.. got it , I thought you are using some method i m not aware of..
Thanks,
Rahul Khandelwal