Jump to content
UBot Underground

Find and replace multiple keywords to multiple text files


Recommended Posts

Hi,

 

I am very new to ubot and I have been searching this forum for a few days already. Here is the flow, I will have several files in a folder. I have here ubot studio 3.515 and it doesn't have $get files command. SO I was thinking,is it possible to have a bat file that contains a command which will allow you to read the files in a folder? That is why I was also thinking of how to open a directory of folder and sub folders in hierarchy which will not show the contents just the folder. Because I can maybe select the source folder of articles then read the files through the bat file and add the titles of the articles to a list.

 

Thanks and hope for your immediate response.

Link to post
Share on other sites

thanks for the reply. how can i use shell command to make that work? i was thinking to save that c:\folder1\forder2...on a notepad and save it as a .bat file. so i was thinking to use the shell command and browse for that file..that file by the way should be pasted on the ubot folder on program files?

Link to post
Share on other sites

thanks for the reply. how can i use shell command to make that work? i was thinking to save that c:\folder1\forder2...on a notepad and save it as a .bat file. so i was thinking to use the shell command and browse for that file..that file by the way should be pasted on the ubot folder on program files?

 

 

have it save the files in that directory to a text file and then you can use that in your ubot coding as a list as needed to pull up each file adding the directory path to the beginning of each list item, and then read from file, and alter as needed.

 

TJ

Link to post
Share on other sites

would it be easier if i convert the text files into csv? I havent find any resource yet on how to do the conversion. Is it possible if i convert the multiple text files into a csv by reading its content and transfer it there.I will do the find and replace of keywords on the csv then after convert it back to individual text files.

Link to post
Share on other sites

you could add each file to a list, replace keywords and re-save the file.

 

Even though a list is used per line

 

It will read you file per line. therefore generating the exact same thing within a list.

 

So add the article to a list, replace the keywords, then save the new article.

Clear list, and start next article

 

looping through all articles your trying to do this for.

 

TJ

Link to post
Share on other sites

Hi,

 

By the way, I have ubot 3.515 and it doesnt have get file from folder command. What is the easiest way to get the files and its content to a csv? Is it possible to create a .bat which can read the contents of the folder and write its contents to 1 file?

Link to post
Share on other sites

yes, i have tried the example given above and it gives just the file title in the directory. IS it possible if it also display the content of each file and merge it in 1 file? i have seen your response about merging files in 1 file but it is for version 4 that has open folder..

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...