Create file for group of data:


 
Thread Tools Search this Thread
Operating Systems Solaris Create file for group of data:
# 1  
Old 05-23-2012
Create file for group of data:

Hi folks,
I have the following data.Any help is greatly appreciated.



order File_name
7222245 7222245.pdf
7222245 7222245a.pdf
7222245 7222245b.pdf
7222245 7222245c.pdf
7222245 7222245d.pdf
7222250 7222250.pdf
7222250 7222250a.pdf
7222250 7222250b.pdf

I have to create files in the below manner using above records for every unique order i have to group the corresponding file names and put them in a seperate file.

For example output for above set is :
7222245.txt
>>7222245.pdf
>>7222245a.pdf
>>7222245b.pdf
>>7222245c.pdf
>>7222245d.pdf
------------------------------------
7222250.txt
>>7222250.pdf
>>7222250a.pdf
>>7222250b.pdf
-------------------------------------


Note: Name of the file is Order.txt and the content is grouped file names.
# 2  
Old 05-23-2012
Code:
perl -lane 'open O, ">> $F[0].txt"; print O $F[1]; close O' Order.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Create file based on data from two other files

I have looked through several threads regarding merging files with awk and attempted using join however have been unsuccessful likely as I do not fully understand awk. What I am attempting is to take a csv file which could be between 1 and 15,000 lines with 5 colums and another csv file that will... (4 Replies)
Discussion started by: cdubu2
4 Replies

2. Shell Programming and Scripting

Create file every year and log data to it

Hi there, Here is what I currently have and trying to come up with a logic to automatically append logs to a respective year file. The log files might get generated everyday or any other day, irrespective of which I want to copy all of the logs for that year into one file /tmp/<year>.log and then... (4 Replies)
Discussion started by: mbak
4 Replies

3. Red Hat

No space in volume group. How to create a file system using existing logical volume

Hello Guys, I want to create a file system dedicated for an application installation. But there is no space in volume group to create a new logical volume. There is enough space in other logical volume which is being mounted on /var. I know we can use that logical volume and create a virtual... (2 Replies)
Discussion started by: vamshigvk475
2 Replies

4. UNIX for Dummies Questions & Answers

How to create a volume group, logical volume group and file system?

hi, I want to create a volume group of 200 GB and then create different file systems on that. please help me out. Its becomes confusing when the PP calculating PP. I don't understand this concept. (2 Replies)
Discussion started by: kamaldev
2 Replies

5. Shell Programming and Scripting

create txt file form data file and add some line on it

Hi Guys, I have file A.txt File A Data AK1521 AK2536 AK3164 I want create text file of all data above and write some data on each file. want Output on below folder /home/kka/out AK1521.txt Hi Welocme (3 Replies)
Discussion started by: asavaliya
3 Replies

6. Shell Programming and Scripting

Copy data form File A and Create File B

File A I have list of : ABCND1 ABCND2 ABCnd3 ABCnd4 I want file B like below Start+ S Pate=ABCND1 AAlo1 S Pate=ABCND1 Q1234 S Pate=ABCND1,P12345 (7 Replies)
Discussion started by: asavaliya
7 Replies

7. UNIX for Dummies Questions & Answers

create new group/delete existing group

Hi, please let me know the commands to create new group/delete existing group in unix and assigning users to newly created group. Thank you in advance. (2 Replies)
Discussion started by: kancherla.sree
2 Replies

8. Shell Programming and Scripting

Split file by data group

Hi all, I'm having a little trouble solving a file split I need to get done. I have the following data: 1. Light 1A. Light Soft texture: it's soft color: the color value is that of something light vital statistics: srm: 23 og: 1.035 sp: 1.065 comment: this is nice if you like... (8 Replies)
Discussion started by: mkastin
8 Replies

9. UNIX for Advanced & Expert Users

Create a file and enter data in columns

Hello!!!!!!!! I have an issue regarding inserting records in a file columnwise.Is it possible using awk/nawk script? Example: File1: 1|AAA|25|2 5|qqe|20|7 4|wer|31|81 I need to create a second file in which data can be inserted in a columnwise manner i.e. File2: AAA|25|1|2... (1 Reply)
Discussion started by: abhijeet1409
1 Replies
Login or Register to Ask a Question