By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,848 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,848 IT Pros & Developers. It's quick & easy.

file sorting

P: 5
Hi,
I Have A File

|0010|1234|abcdftg |testin
|0120|233|efdidufhh |tesifn
|0102|234|acderuir |testing

Can Anyone Give A Sort Program To Sort Of Filed 3

Thanks
Antony
Jan 16 '08 #1
Share this Question
Share on Google+
5 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
Hi,
I Have A File

|0010|1234|abcdftg |testin
|0120|233|efdidufhh |tesifn
|0102|234|acderuir |testing

Can Anyone Give A Sort Program To Sort Of Filed 3

Thanks
Antony
Because this is a learning forum and not a scripting service, no, we will not just give you a program. But, you can attempt to do the task and post your code when you get stuck.

Regards,

Jeff
Jan 16 '08 #2

eWish
Expert 100+
P: 971
There are some Articles in the Howtos section that explain sorting. Also, you can learn more about using sort in the perldocs .

--Kevin
Jan 16 '08 #3

prn
Expert 100+
P: 254
prn
Antony, please read the Posting Guidelines. Jeff posted a link in the sticky post Guidelines To Ensuring Better Answers and Assistance To Your Thread(s) at the top of the forum. There is a good reason for the sticky posts. Please read both Jeff's post and the Posting Guidelines.

That said, sometimes you want to sort using the Perl sort function described in the HowTos indicated above, which is very good, and sometimes it's just easier to sort a text file using the *ix sort routine, which is extremely good. Read the man page (man sort) and figure out what this does:
Expand|Select|Wrap|Line Numbers
  1. sort -t'|' -k3 ctmlog
You may find the answer to your question. (Or perhaps not. It depends on what your question really is.)

HTH,
Paul
Jan 16 '08 #4

KevinADC
Expert 2.5K+
P: 4,059
I got his second PM (this thread). Now he's just on my ignore list.
Jan 16 '08 #5

eWish
Expert 100+
P: 971
Antointoronto,

It was brought to your attention that sending PM's to the Experts and Moderators regarding your threads, was not acceptable practice here at TSDN. You have contnued to ingore this policy. Therfore, you will be temporrially banned for a period of one week.

Please read the Posting Guidlines before making any additional posts once the ban has been lifted.

Regards,

MODERATOR
Jan 16 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.