ascii sorting in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ascii sorting in unix
# 1  
Old 10-14-2008
ascii sorting in unix

Hi all
i am facing a problem in sorting command. The script depending on the sorting command works fine only if ascii sorting is done.
i need to know how to find out how to perform ascii sorting. sorting is case insensitive in
my file has data in the following format.
AA/BB/
AAA/BB\

also the presence of slashes (both forward and backward slashes)will differ when i perform ascii sorting.
# 2  
Old 10-14-2008
sort orders lists using what is called a collating sequence. This is defined by your locale.
If sort does not work the way you want in terms of ordering a file, you need to look into changing locales when you sort. The POSIX locale (C is another name for it) sorts in "ascii" order.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Hex to Ascii in a Ascii file

Hi All, I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting? Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies

2. Shell Programming and Scripting

Need help for EBCDIC TO ASCII conversion through UNIX

Hi All , We have a mainframe file which is in EBCDIC format.We dont have direct access to mainframe ,client has provided us the mainframe file in unix box.The mainframe file is containing pact data(COMP1 ,COMP2 etc) which are unreadble.Can anyone suggest me how to convert this kind of ebcdic... (7 Replies)
Discussion started by: STCET22
7 Replies

3. Shell Programming and Scripting

File conversion from Binary to ASCII though UNIX command

Hi All , I have a mainframe file which contains the data in EBCDIC format.I have downloaded this file from mainframe to windows in binary format(unreadable raw data).Now I want convert this file to ASCII format(readable format data) through Unix command.I have tried iconv but that is not working... (2 Replies)
Discussion started by: STCET22
2 Replies

4. UNIX for Dummies Questions & Answers

EBCDIC TO ASCII Conversion through UNIX Command

Hi All , I have a mainframe file which contains the data in EBCDIC unreadable format.I have downloaded this raw unreadable file from mainframe system to windows in text format then I pushed to Unix system.Now I want to convert this file to ASCII readable format file in unix.Can anyone advise me... (2 Replies)
Discussion started by: STCET22
2 Replies

5. UNIX for Advanced & Expert Users

How to display the ascii characters in java using unix OS

The below code is not able to converting the Hexa decimal characters into Ascii characers in Unix. byte bytes = newbyte; for(int i=0;i<bytes.length;i++){ bytes = (byte)Integer.parseInt(hex.substring(2*i, 2*i+2),16); } String multi = new String(bytes); System.out.println(" multi value from... (0 Replies)
Discussion started by: srinivaspeyyala
0 Replies

6. UNIX for Dummies Questions & Answers

Sorting data in an ASCII file

Hi,,, is there anyway to sort the data that I have on an ASCII file, using unix? :confused::confused::confused: Thanks (2 Replies)
Discussion started by: cosmologist
2 Replies

7. UNIX for Dummies Questions & Answers

sorting ASCII string containing numbers

I have the following output where I need to sort the second column numerically (starting with IBMULT3580-TD10 and ending in IBMULT3580-TD123) Drv DriveName 0 IBMULT3580-TD13 1 IBMULT3580-TD18 2 IBMULT3580-TD14 3 IBMULT3580-TD10 4 IBMULT3580-TD11 5 IBMULT3580-TD17 ... (8 Replies)
Discussion started by: GKnight
8 Replies

8. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

9. UNIX for Dummies Questions & Answers

sorting an ascii file

I would like to sort a large ascii file. Primary sort on the 1st column, and secondary sort on the second column. The file consists of 10 rows of header text and then thousands of rows with 6 columns. I want to sort all of the rows by the first column and second column. As an example, here is... (2 Replies)
Discussion started by: shes
2 Replies

10. Shell Programming and Scripting

Non-ASCII charaters in a unix file

Hi, Could you pls help me with the command to know the non-ascii characters in a unix file. Thanks (1 Reply)
Discussion started by: gaurav_gaba
1 Replies
Login or Register to Ask a Question