Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##################################################################
- ##
- ## USAGE & README
- ##
- ##################################################################
- # e.g. we have 3 files *.txt jules.txt, jules2.txt jules3.txt in the directory "jules":
- f00@localhost ~$ cd jules/
- f00@localhost jules$ ls
- jules2.txt jules3.txt jules.pl jules.txt
- # there are different ways of having the jules.pl script having all this files parsed.
- # either one can make them all into one, or one can call jules.pl on each of them
- # first way is using only FIND to list all files named *.txt and then execute the code "perl jules.pl" for each of these:
- f00@localhost jules$ find . -name "*.txt" -exec perl jules.pl {} \;
- 1.1.2003 4
- 2.4.2085 7
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 1.1.2003 4
- 2.4.2085 7
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 1.1.2003 4
- 2.4.2085 7
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- # works
- # we could also make them all into one new file: "all.all" first and have the formated output into the file "result.res":
- # warning: i named the files all.all and result.res because all files ending with ".txt" in this directory will be used offcourse
- f00@localhost jules$ find . -name "*.txt" | xargs cat >> all.all
- f00@localhost jules$ cat all.all
- 1.1.2003 4 2.4.2085 7 2.1.2054 6
- 2.1.2054 6 2.1.2054 6 2.1.2054 6
- 1.1.2003 4 2.4.2085 7 2.1.2054 6
- 2.1.2054 6 2.1.2054 6 2.1.2054 6
- 1.1.2003 4 2.4.2085 7 2.1.2054 6
- 2.1.2054 6 2.1.2054 6 2.1.2054 6
- # ... and now call jules.pl on all.all to optain result.res
- f00@localhost jules$ perl jules.pl all.all >> result.res
- f00@localhost jules$ cat result.res
- f00@localhost jules$ cat result.res
- 1.1.2003 4
- 2.4.2085 7
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 1.1.2003 4
- 2.4.2085 7
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 1.1.2003 4
- 2.4.2085 7
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- 2.1.2054 6
- #works!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement