' A single quote or apostrohe character is a POSIX extension to ISO C. It indicates
that the integer part of a floating point value, or the entire part of an
integer decimal value, should have a thousands-separator character in it. This
only works in locales that support such characters. For example:
$ cat thousands.awk # Show source program
a BEGIN { printf "%'d\n", 1234567 }
$ LC_ALL=C gawk -f thousands.awk # Run it in "C" locale
a 1234567
$ LC_ALL=en_US.UTF-8 gawk -f thousands.awk # Run in US English
UTF locale
a 1,234,567
maybe it works for the manual
still it doesn't work for me
The
solution did not work for me either. I have GNU AWK 3.1.5. The man doesn't mention apostrophe among printf format options, and I don't have thousands.awk file.
This solution
will not work, because only the #,### pattern gets repeated. It becomes more clear when you add a few longer numbers to the list.
I created the following solution:
Note! This will not work with non-integers (i don't need it for my script), but it can be extended with some effort!
Hi to all,
I have thousand of files in a folder with names with format "FILE-YYYY-MM-DD-HHMM" for what I want to send the following AWK command
awk '/Code.*/' FILE-2014*
I'd like to separate all files that have the same date to a folder named with the corresponding date. For example, if I... (7 Replies)
Hi All,
I want to search for a certain string in thousands of files and these files are distributed over different directories created daily. For that I created a small script in bash but while running it I am getting the below error:
/ms.sh: xrealloc: subst.c:5173: cannot allocate... (17 Replies)
I need to find a smarter way to process about 60,000 files in a single directory.
Every night a script runs on each file generating a output on another directory; this used to take 5 hours, but as the data grows it is taking 7 hours.
The files are of different sizes, but there are 16 cores... (10 Replies)
Folder of e-mails in maildir format had been corrupted. Typical file name is 1246281161.6777.m21JH:2,S . The " :2,S prevents " copying to another device. How can I simply remove the last four characters? (2 Replies)
There is a procedure I do here at work where I have to synchronize file systems. The source file system always has three or four directories of hundreds of thousands of tiny (1k or smaller) or empty files. Whenever my rsync command reaches these directories, I'm waiting for hours for those files... (3 Replies)
Hi experts,
I have thousands of file (data file and Gziped file) in same directory like below--
bash-2.05$ pwd
/home/mmc
bash-2.05$ file PP023149200709270546
TT023149200709270546: gzip compressed data - deflate method
bash-2.05$ file PP027443200711242320
TT027443200711242320: ... (10 Replies)
Hi All,
I want to find a specific pattern from approximately 400000 files on solaris platform. Its very heavy for me to grep that pattern to each file individually.
Can anybody suggest me some way to search for specific pattern (alpha numeric) from these forty thousand files. Please note that... (6 Replies)
Hey all,
I have a box running SUSE SLES 8 and in the past few months the box will randomly spawn thousands of instances of /USR/SBIN/CRON to the point where the box will lock up entirely. Upwards of 14000 instances! I imagine it's using up all of the available files that can be opened at one... (10 Replies)