i have a text file and i need its content to copy and paste in an excel sheet columns
You can read a text file by using Read Text File activity this will give you a string output.
Perform string manipulations to get your content and use Write Cell activity to write into excel
i have a txt file of min 500 rows and that is taking too much time to write each cell to excel
Hello @Mz12 , did you get this resolved please? I have same requirement, your inputs will be highly appreciable.
can you attach the txt file to get idea. If you feel that the file is confidential , you can send it thru message. It is secured.
Thanks for your reply. I have attaached the screen shot how the .txt file looks like. I want to seprate the data as mentioned below.
Line in file looks like :
How I want it to be separated:
J 95306 1100 0000 000 0 000 C 00000000018630 ;INS;2018;1600042949;H
As a manual process I copy the data into excel and use Text to Columns function–>Fixed Width–>I will click on each place where a separate column is required and finish it. I would see the columns get separated.
I want to achieve the same functionality. Please note that the excel file would have more than 1000 lines in it. The Read text file activity would take good amount of time to separate each row.
It would be highly appreciable if you could put in your thoughts in achieving the requirement.
Hi @vankashok ,
Yes we can do it. A separate custom activity is there !
Thanks for the quick response @balupad14.
Can you please advise what is the custome activity and how I can use it ?
Rename text file extension as “.csv”.
Create a excel file called “Result.xlsx”.
Configure the package “BalaReva” like below and save it. after that open the sample project.
Here is the result file. Result.xlsx (8.2 KB)
Project file.vankashok.zip (7.7 KB)
Thank you so much @balupad14
I would provide an update once I am done.
I want the line to be separated as mentioned below. May the code need to be corrected to fit the bill. Is it possible to do correct it please ?
Please note that I have separated the line with ‘-’, I would need them in a separate column in excel.
Change the delimiter as “-”. It will split the text by “-” and separated as the columns.
You have taken it wrongly my friend. Let me put it again.
Actually there is no delimiter, it is a single string “J95306110000000000000C00000000018630” but when I export them into excel I want it to be separated as : 'J | 95306 | 1100 | 0000 | 000 | 0 | 000 | C | 00000000018630| ;INS;2018;1600042949;H| "
The package you have provided is separating the string like ‘J95306110000000000000C00000000018630 | INS | 2018 | 1600042949 | H’
Is there any way we can achieve this.
Here is the output :
Sample Project : vankashlok1.zip (2.3 KB)
I really appreciate all your help.
Am I allowed to give a call or text you in person please? I have few more doubts, I would be glad if you could advise the means to connect.
In our forum community , We have a lot of users (MVP,Leader,regular and all).Technically they know more than me. So post your doubts and problems. Many users (including me) will give the solutions and advises to your problems. And it is good place to discuss about the issues to get many opinions from varies users.
If you got the solution to this problem.Please mark it as solved(closed) .
Hello. The second green arrow has blocked the location of the balareva activity. Only C:\Temp\Cate… is visible
Thank you so much for your advise @balupad14. I totally respect your words.
Coming back to my questions.
The solution you have provided to separate the line in text file, I need to use Readtext activity first to read each line in the file and then call the code your have provided to seprate the line ? Please correct me if I am wrong
The custom activity what you have build would not fit for my case ?