当前位置:网站首页>Write one file to the marked location of another file
Write one file to the marked location of another file
2022-06-25 15:42:00 【Never, calm down】
Will file A Write to file B The location of the identifier
Ideas
sed -i ‘’ ‘10r file-a.js’ ./file-b.js
lookup identifier grep -n -r insertModuleFile ./file-b.js | awk -F “{ print $2 }”
Realization
file A
function ModuleFile(){
// This is a test file
}
file B
function getModuleFile(){
// insertModuleFile
}
Expected results
function getModuleFile(){
// insertModuleFile
function ModuleFile(){
// This is a test file
}
}
Script
sed -i '' "$(grep -n -r insertModuleFile ./file-B.js | awk -F : '{ print $2 }')r ./file-A.js" ./file-B.js
Script
sed -i '' "$(grep -n -r insertModuleFile ./worklet-process-sed.js | awk -F : '{ print $2 }')r ./dist/Math.js" ./worklet-process-sed.js
边栏推荐
- Asynchronous processing of error prone points
- Architecture evolution of high-performance servers -- Suggestions
- Binocular 3D perception (I): preliminary understanding of binocular
- TFIDF与BM25
- 异步处理容易出错的点
- Golang regular regexp package uses -05- extend expand(), cut split() according to the rule
- 免费送书啦!火遍全网的AI给老照片上色,这里有一份详细教程!
- 04. binary tree
- CV pre training model set
- 通俗讲跨域
猜你喜欢

MySQL transaction characteristics and implementation principle

MySQL performance optimization - index optimization

Sword finger offer II 091 Paint the house

Learning to Measure Changes: Fully Convolutional Siamese Metric Networks for Scene Change Detection

通俗讲跨域

CV pre training model set

TFIDF与BM25

Sword finger offer 07 Rebuild binary tree

剑指 Offer II 091. 粉刷房子

Kali modify IP address
随机推荐
Differences between = = and = = = in JS (detailed explanation)
For the first time in Chinese universities! Unique in the world! Tongji students win international awards
[golang] leetcode intermediate - find the first and last position of an element in a sorted array & Merge interval
Record the time to read the file (the system cannot find the specified path)
After the project is pushed to the remote warehouse, Baota webhook automatically publishes it
Why is it said that restarting can solve 90% of the problems
Could not connect to redis at 127.0.0.1:6379 in Windows
Solve the go project compilation error go mod: no such file or directory
数据类型的内置方法
Learning to Measure Changes: Fully Convolutional Siamese Metric Networks for Scene Change Detection
Client development (electron) system level API usage
Summary of four parameter adjustment methods for machine learning
Several solutions to the distributed lock problem in partial Internet companies
[paper notes] mcunetv2: memory efficient patch based influence for tiny deep learning
Golang uses Mongo driver operation - increase (Advanced)
免费送书啦!火遍全网的AI给老照片上色,这里有一份详细教程!
[paper notes] overview of case segmentation
golang使用mongo-driver操作——增(进阶)
Completabilefuture of asynchronous tools for concurrent programming
Highly concurrent optimized Lua + openresty+redis +mysql (multi-level cache implementation) + current limit +canal synchronization solution