Replacing text in a file from a list in another file?

前端 未结 4 506
渐次进展
渐次进展 2020-12-21 15:18

I asked this question before but don\'t think I really explained it properly based on the answers given.

I have a file named backup.xml that is 28,000 l

4条回答
  •  借酒劲吻你
    2020-12-21 15:53

    Using awk. It reads backup.xml file and when found a *** text, I extract a word from the list.txt file. The BEGIN block removes list.txt from the argument list to avoid its processing. The order of arguments is very important. Also I assume that there is only one *** string per line.

    awk '
            BEGIN { listfile = ARGV[2]; --ARGC }
            /\*\*\*/ {
                    getline word 

提交回复
热议问题