Well if you were using a real OS with a decent set of command line tools, then I would suggest http://www.manpagez.com/man/1/cut/
But since you seem (from your other posts) to be using an OS where all you can do is attempt to create fine art with wax crayons, then I dunno.
Download ActiveState perl would be one suggestion.
The only command in windows console that doesn't get really messy in a hurry is 'exit' ;)
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,875
Solved Threads: 953
Skill Endorsements: 27
In a shell environment, doing arithmetic on various columns, awk is your friend. (Well, I guess it isn't really friendly, but it is efficient and useful). You can use expr, but awk is easier (once you understand it) and faster, if that matters.
I don't understand your 'need to find file from any given location' requirement. If the file has an absolute path, use it. If it has a path relative to $HOME or some other variable, use the variable. If you need to let the user specify it, make your tool into an executable script and require a file name argument: Interactively reading an answer is not very 'unixy'.
griswolf
Veteran Poster
1,176 posts since Apr 2010
Reputation Points: 344
Solved Threads: 262
Skill Endorsements: 1