Column A contains the data as text.

 [ [(q/log/arr], [asj89/log/arrwer], [asj12/log/arrwer0/io9], [ty/asjrt2/log/arrwer/tr09)`] ] 

etc.

Please tell the script to replace the word log in the column A with the word rep . And also remove all spaces in column A

  • And here google-apps-script ? - oshliaer
  • one
    You mean that Google Spreadsheets is used and the data that you gave separated by commas - are they located separately in each cell? If so, then it can be done without a script - with formulas. Or is the task purely scripted? Show your script that you did not work there. - Sergey Pryanichkin
  • @ SergeyPryanichkin, most likely there is nothing there - the usual search for freebies. - oshliaer
  • Yes, the script needs to edit the data in the column. The formula does not fit otherwise I would not ask. Unfortunately, there is no script, since I could not even find an example. - Sergun
  • @Sergun, you should make a little effort. At least get the range data, and then write ??? что делать дальше? ??? что делать дальше? - oshliaer

1 answer 1

For data

 | A | |-----------------------------| | (q/log/arr | | asj89/log/arrwer dsfg sdg f | | asj12/log/arrw er0/io9 | | ty/asjrt2/log/arrwer/tr09)` | 

The approach is usually

 function myFunction() { var range = SpreadsheetApp.getActiveSpreadsheet() .getRange("Sheet1!A:A"); range.setValues(range.getValues().map(blackBox_)); } function blackBox_(row){ return [row[0].replace("log", "rep").replace(/\s+/g, "")]; } 

Result

 | A | |-----------------------------| | (q/rep/arr | | asj89/rep/arrwerdsfgsdgf | | asj12/rep/arrwer0/io9 | | ty/asjrt2/rep/arrwer/tr09)` | 

Through the formula

 =ARRAYFORMULA(REGEXREPLACE(REGEXREPLACE(A:A,"log","reg")," ",""))