Sponsored Content
Top Forums UNIX for Dummies Questions & Answers sort lines in different files based on the starting letter Post 302354428 by jathin12 on Friday 18th of September 2009 05:43:35 AM
Old 09-18-2009
Bug sort lines in different files based on the starting letter

Hi ,,
i have the below file...

D 2342135
B 214236
C argjlksd
V lskjrghaklsr
C slkrgj
B sdg4tsd
E aslkgjlkasg


i want to sort the lines into different files based on the starting letter of the line. so that i have different files for lines starting with a letter.

thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sum of Files Sizes starting with a letter...

Can we find some of size of all files in a directry where file names start with an letter t* the out put of ls -ls t* is 4 -rw-r--r-- 1 root system 61 Jul 03 10:56 t 4 -rw-r--r-- 1 root system 3146 Jul 19 11:11 t1 4 -rw-r--r-- 1 root system ... (2 Replies)
Discussion started by: pbsrinivas
2 Replies

2. Shell Programming and Scripting

Remove lines, Sorted with Time based columns using AWK & SORT

Hi having a file as follows MediaErr.log 84 Server1 Policy1 Schedule1 master1 05/08/2008 02:12:16 84 Server1 Policy1 Schedule1 master1 05/08/2008 02:22:47 84 Server1 Policy1 Schedule1 master1 05/08/2008 03:41:26 84 Server1 Policy1 ... (1 Reply)
Discussion started by: karthikn7974
1 Replies

3. Shell Programming and Scripting

Sort and extract based on two files

Hi, I am having trouble sorting one file based on another file. I tried the grep -f function and failed. Basically what I have is two files that look like this: File 1 (the list) gh aba for hmm File 2 ( the file that needs to be sorted) aba 2 4 6 7 for 2 4 7 4 hmm 1 ... (3 Replies)
Discussion started by: phil_heath
3 Replies

4. Homework & Coursework Questions

Grep for filetype starting with letter p

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Which files in /usr/bin whose names begin with “p” are python scripts? Store the numbered results in... (3 Replies)
Discussion started by: alindner
3 Replies

5. Shell Programming and Scripting

Get all File names starting with letter P

Hi, I have lets say 10 files , I need to process them one by one. So I need a command to get one file name at a time to process it into a variable Example Files P1111.dat P3344.dat S344.dat ... v_file_name = 'p111.dat' .. I will rename it to something after processing ... (1 Reply)
Discussion started by: prassu
1 Replies

6. Shell Programming and Scripting

Sort and extract based on two files

Hi, I am having trouble sorting one file based on another file. I tried the grep -f function and failed. Basically what I have is two files that look like this: File 1 (the list) gh aba for hmm File 2 ( the file that needs to be sorted) aba 2 4 6 7 for 2 4 7 4... (4 Replies)
Discussion started by: phil_heath
4 Replies

7. Shell Programming and Scripting

BASH: Sort four lines based on first line

I am in the process of sorting an AutoHotkey script's contents so as to make it easier for me to find and view its nearly 200 buzzwords (when I forget which one corresponds with what phrase, which I do now and then). About half to two-thirds of the script's key phrases correspond to locations... (7 Replies)
Discussion started by: SilversleevesX
7 Replies

8. Shell Programming and Scripting

sort the files based on timestamp and execute sorted files in order

Hi I have a requirement like below I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory My files looks like this PGABOLTXML1D_201108121235.xml... (1 Reply)
Discussion started by: saidutta123
1 Replies

9. Shell Programming and Scripting

Remove duplicate lines based on field and sort

I have a csv file that I would like to remove duplicate lines based on field 1 and sort. I don't care about any of the other fields but I still wanna keep there data intact. I was thinking I could do something like this but I have no idea how to print the full line with this. Please show any method... (8 Replies)
Discussion started by: cokedude
8 Replies

10. UNIX for Dummies Questions & Answers

Sort alphabetically starting from specified letter

Hi. I'm trying to sort a list of items in a file alphabetically but starting from the letter 'X'. For instance if I had the following file; test.txt Z A T W Y B S X I would like the output to look like; X Y (8 Replies)
Discussion started by: mmab
8 Replies
CSSORT(1p)						User Contributed Perl Documentation						CSSORT(1p)

NAME
cssort -- Czech sort FORMAT
cssort [ "-c"list | "-f"list ["-d"regexp]] [files ...] SYNOPSIS
cssort -c10-15,50-,25-45 < file cssort -f3,5-6 < file cssort -f3,5-6 -s: < file DESCRIPTION
Cssort is a utility that sorts input lines according to rules used in the Czech language. You can run it without any options, then it just uses whole lines for sorting. With the options, it's possible to specify parts of the lines to be used for comparison. list A comma-separated list of integer field numbers or field ranges. The are indexed from 1 and if a range is open (eg. "5-"), it means all remaining fields from the starting number. -c Stands for columns and the list that follows specifies byte ranges on the line. You will probably use this option to sort data with fixed width fields. -f Fields that will be used for sort. -d Delimiter that separates fields in the -f option. It is a Perl regular expression, the default is "[ ]+", which means any number of spaces or tabs in a row. The program assumes ISO-8859-2 encoding. Some way to specify another input encoding will come in the next versions. If you need to sort files with different encodings, you might want to check the cstocs conversion utility. SEE ALSO
Cz::Sort(3), cstocs(1). AUTHOR
Jan Pazdziora, adelton@fi.muni.cz. perl v5.10.1 2010-01-16 CSSORT(1p)
All times are GMT -4. The time now is 10:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy