sort: cannot create tempory file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sort: cannot create tempory file
# 1  
Old 02-19-2012
sort: cannot create tempory file

Hi, I'm having a bit of trouble running a line of code below:

Code:
 
gawk -F"," '/F/{print $6}' OFS="," large_csv_file.csv | sort | uniq -c >> 01_SUMMARY_UNIQUECHECK.csv

The code runs fine on small .csv files but on large files I get the following error:

Quote:
/cygdrive/c/PROGRA~2/VULCAN~1/bin/cygnus/bin/sort: cannot create temporary file:/tmp/sortd1Frr8: No such file or directory
gawk: cmd. line:1: (FILENAME=Check_zeroval_dmstr341_rescat3.csv FNR=165122) fatal: print to "standard output" failed (reason unknown)
I assumed from the error that my tempory directory folder is exceeding it's size limit and is getting maxed out by the sort command. I tried changing my environment variable for TMP to another empty folder, but it hasn't made any difference.

I'm just after a few ideas or maybe a work-around solution.

Cheers Smilie
# 2  
Old 02-20-2012
gawk

Why cant you use asort function in gawk to sort out your file content?
Redirection have some limitations, i think. Do your all sorting in gawk itself.
Cheers,
ranga:-)
This User Gave Thanks to rangarasan For This Post:
# 3  
Old 02-20-2012
Have you tried setting the standard variable TMPDIR instead of "TMP" ? If that does not help (it should) then your sort may have a -T option so you can set the temporary sort directory explicitly.

Last edited by Scrutinizer; 02-20-2012 at 02:01 AM..
This User Gave Thanks to Scrutinizer For This Post:
# 4  
Old 02-20-2012
Thanks guys, the suggestion by Scrutinizer works Smilie) Thanks also to rangarasan, I didn't know about the asort function and i'll check it out Smilie)
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to align/sort the column pairs of an csv file, based on keyword word specified in another file?

I have a csv file as shown below, xop_thy 80 avr_njk 50 str_nyu 60 avr_irt 70 str_nhj 60 avr_ngt 50 str_tgt 80 xop_nmg 50 xop_nth 40 cyv_gty 40 cop_thl 40 vir_tyk 80 vir_plo 20 vir_thk 40 ijk_yuc 70 cop_thy 70 ijk_yuc 80 irt_hgt 80 I need to align/sort the csv file based... (7 Replies)
Discussion started by: dineshkumarsrk
7 Replies

2. AIX

Sort file

as friends can only Sort this file with awk from low to high from position 3 to 9 bone this: 0003344 A70003344prueba1 A70003347prueba1 A70003345prueba1 A70003349prueba1 A70003343prueba1 A70003342prueba1 (4 Replies)
Discussion started by: tricampeon81
4 Replies

3. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

4. Shell Programming and Scripting

Help with sort word and general numeric sort at the same time

Input file: 100%ABC2 3.44E-12 USA A2M%H02579 0E0 UK 100%ABC2 5.34E-8 UK 100%ABC2 3.25E-12 USA A2M%H02579 5E-45 UK Output file: 100%ABC2 3.44E-12 USA 100%ABC2 3.25E-12 USA 100%ABC2 5.34E-8 UK A2M%H02579 0E0 UK A2M%H02579 5E-45 UK Code try: sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies

5. Shell Programming and Scripting

Unix Scripting : Sort a Portion of a File and not the complete file

Need to sort a portion of a file in a Alphabetical Order. Example : The user adam is not sorted and the user should get sorted. I don't want the complete file to get sorted. Currently All_users.txt contains the following lines. ############## # ARS USERS ############## mike, Mike... (6 Replies)
Discussion started by: evrurs
6 Replies

6. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

7. Shell Programming and Scripting

Read a file and search a value in another file create third file using AWK

Hi, I have two files with the format shown below. I need to read first field(value before comma) from file 1 and search for a record in file 2 that has the same value in the field "KEY=" and write the complete record of file 2 with corresponding field 2 of the first file in to result file. ... (11 Replies)
Discussion started by: King Kalyan
11 Replies

8. Shell Programming and Scripting

Need to sort file

Hi, I have a file with the list of RPMs in the following format unix-abc-bin-1.27.1-006901 unix-abc-cfg-1.27.1-006901 unix-xyz-bin-1.27.1-006901 unix-abc-bin-1.27.2-006902 unix-xyz-bin-1.27.2-006902 unix-xyz-img-1.27.2-006902 I need the output as shown below unix-abc-bin-1.27.2-006902... (4 Replies)
Discussion started by: learnerlearner
4 Replies

9. UNIX for Dummies Questions & Answers

how to sort a file

Hi, i want to sort a file by column 2, 3, 10 and 4(in this order), can anybody help me? thanks a lot. (2 Replies)
Discussion started by: tao
2 Replies
Login or Register to Ask a Question