Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input{ch1.tex}
- input{ch2.tex}
- ...
- $ cat file1.txt
- foo
- bar
- qweinput{file2.txt}asdinput{file3.txt}zxc
- baz
- $ cat file2.txt
- qux
- quux
- quuux
- $ cat file3.txt
- xyzzy
- xyzzzy
- $ <file1.txt perl -pe 's/\input{([^}]*)}/open $1,"<$1";join("",<$1>)/ge'
- foo
- bar
- qwequx
- quux
- quuux
- asdxyzzy
- xyzzzy
- zxc
- baz
- gawk '
- match($0, /\input{([^}]+)/, a) {
- system("cat " a[1])
- next
- }
- {print}
- '
Add Comment
Please, Sign In to add comment