Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save BUNotesAI/297316c0fac98ca1c7de9c6b1e683d55 to your computer and use it in GitHub Desktop.

Select an option

Save BUNotesAI/297316c0fac98ca1c7de9c6b1e683d55 to your computer and use it in GitHub Desktop.
拷贝文件增加序号
awk '{print NR "," $0}' yuliaoku.txt > yuliaoku2.txt
cat 1.txt | clj -e '(->> (repeatedly #(read-line)) (take-while some?) (map-indexed #(str %1 "," %2)) (clojure.string/join \newline) print)' > 1_out.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment