#xml #csv #tags #file #update #cli #content

bin+lib transr

A Cli to update xml tag content from csv content

8 releases

0.2.5 Oct 23, 2023
0.2.4 Oct 22, 2023
0.1.1 Oct 15, 2023

#70 in #update

Download history 1/week @ 2024-02-17 3/week @ 2024-02-24 9/week @ 2024-03-09 3/week @ 2024-03-30 6/week @ 2024-04-06 80/week @ 2024-04-13

89 downloads per month

MIT/Apache

8KB
148 lines

Transr

A Cli mass-updates a XML tag content from csv input.

Run transr -h to get details.

How it works

Open sample file, it does simple logic as below.

Loop all rows in csv {
   column1(`Target_Customer_Type__c`) -- match -> xml file (`ABCTarget_Customer_Type__cDEF.xml`)

   column2(`help`) -- find --> (`<help>foo</help>`) in the matched xml file

   column3(`info_to_update!`) -- update --> (`<help>info_to_update!</help>`) and save
   the xml file
}

How to use it

  1. prepare file.csv with matched columns (api_name,xml_tag,content), check sample file
  2. prepare translation files in xml folder, check sample folder
  3. use -d to dry run until all file updates are as expected
  4. run it without -d to write into xml files

How to install

If you have Cargo, run cargo install transr to install it locally.

To-Do

  • Add test scenarios
  • Generalize the usage?

Dependencies

~2.5MB
~37K SLoC