Sponsored Content
Top Forums Shell Programming and Scripting list all file whose 2nd char is digit! Post 302327354 by ghostdog74 on Sunday 21st of June 2009 05:13:18 AM
Old 06-21-2009
no need. hint: ?[0-9]*
This User Gave Thanks to ghostdog74 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Substitutions in a file from list in a 2nd file

I made a rash statement yesterday that I could do this easier in Linux than on Windows with VBS but looking at it I'm a bit stuck. I have a large fixed-width data file auto-generated by a database for printing delivery labels that's full of tags and flags for the printers. I need to compare the... (8 Replies)
Discussion started by: fj1200
8 Replies

2. Shell Programming and Scripting

Replace one digit by two digit using sed

Folks, Is there a simple way to replace one digit by two digit using sed. Example, mydigit1918_2006_8_8_lag1.csv should be mydigit1918_2006_08_08_lag01.csv. I tried this way, but doesn't work. echo mydigit1989_2006_8_8_lag1.csv|sed 's/]/0]/' Thank you, (5 Replies)
Discussion started by: Jae
5 Replies

3. UNIX for Dummies Questions & Answers

Replacing digit with characters in a file

Hi, I have a file with 40 columns out of which 15 are amount fields. There are approximately 6 mn records in this file. The file has data in following format: 123A,Ank,00.468,US,IL,780,53489 253A,Tng,-00.456,US,CA,452,46781 363A,nkk,-00.023,US,NJ,539,09625 I need to take all amount fields... (1 Reply)
Discussion started by: wahi80
1 Replies

4. Shell Programming and Scripting

AWK: list files with 1rst col=N and char position 123=N

I need to list all files where 1rst column=ABK and char position 123 to 125=ZBK: For the first part I can I can do a awk '{$1="ABK";print}' file and for the second a cut -c123-125 file | grep ZBK but this would only work partially.. How can I do this with only one awk command ? Thanks in... (10 Replies)
Discussion started by: cabrao
10 Replies

5. UNIX for Dummies Questions & Answers

list all files containing 4 digit number using grep

how can i list all files in my home directory that have a 4 digit id number, the line number where the id is located and the id itself not printing the entire line? (5 Replies)
Discussion started by: hobiwhenuknowme
5 Replies

6. Shell Programming and Scripting

awk length of digit and print at most right digit

Have columns with digits and strings like: input.txt 3840 3841 3842 Dav Thun Tax Cahn 146; Dav. 3855 3853 3861 3862 Dav Thun Tax 2780 Karl VI., 3873 3872 3872 Dav Thun Tax 3894 3893 3897 3899 Dav Thun Tax 403; Thun 282. 3958 3959 3960 Dav Thun Tax 3972 3972 3972 3975 Dav Thun Tax... (8 Replies)
Discussion started by: sdf
8 Replies

7. Shell Programming and Scripting

convert two digit in to single digit...

Hi Guys. My Input: ABCD 12 00 KL ABCD 12 08 DL ABCD 12 10 KK ABCD 12 04 LL ABCD 13 00 LP ABCD 13 1O LS Output: ABCD 12 0 KL ABCD 12 8 DL ABCD 12 10 KK ABCD 12 4 LL ABCD 13 0 LP (2 Replies)
Discussion started by: pareshkp
2 Replies

8. UNIX for Beginners Questions & Answers

List all file whose 3rd char is digit

list all file whose 3rd char is digit (or Nth position is digit) what will be the required command? (5 Replies)
Discussion started by: rahul
5 Replies

9. UNIX for Beginners Questions & Answers

Help with moving list of data to 2nd column of HTML file

Hi Team, Can you help me with writing shell script to printing the list output to 2nd column in HTML file. (2 Replies)
Discussion started by: veereshshenoy
2 Replies

10. UNIX for Beginners Questions & Answers

I need to find in a file a list of number where last two digit end in a range

I all I am tryng to find a way to sort a list of number in a file by the value of last two digit. i have a list like this 313202320388 333202171199 373202164587 393202143736 323202132208 353201918107 343201887399 363201810249 333201805043 353201791691 (7 Replies)
Discussion started by: rattoeur
7 Replies
vprintf(3int)															     vprintf(3int)

Name
       vprintf, vfprintf, vsprintf - print formatted output of a varargs argument list

Syntax
       #include <stdio.h>
       #include <varargs.h>

       int vprintf ( format, ap )
       char *format;
       va list ap;

       int vfprintf ( stream, format, ap )
       FILE *stream;
       char *format;
       va list ap;

       int vsprintf ( s, format, ap )
       char *s, *format;
       va list ap;

Description
       The international functions and are similar to the standard I/O functions.

       Likewise,  the  vprintf functions are similar to the printf functions except they are called with an argument list as defined by instead of
       with a variable number of arguments.

       The international functions allow you to use the %digit$ conversion character in place of the % character  you  use  in	the  standard  I/O
       functions.   The digit is a decimal digit n from 1 to 9.  The international functions apply conversions to the nth argument in the argument
       list, rather than to the next unused argument.

       You can use the % conversion character in the international functions.  However, you cannot mix the % conversion character with the %digit$
       conversion character in a single call.

       You  can  indicate  a  field  width or precision by an asterisk (*) instead of a digit string in format strings containing the % conversion
       character. If you use an asterisk, you can supply an integer arg that specifies the field width or precision.  In format strings containing
       the  %digit$  conversion character, you can indicate field width or precision by the sequence *digit$.  You use a decimal digit from 1 to 9
       to indicate which argument contains an integer that specifies the field width or precision.

       The conversion characters and their meanings are identical to

       You must use each digit argument at least once.

Examples
       #include <stdio.h>
       #include <varargs.h>

       main()
       {
       char *function_name = "vpr";
       char *arg1 = "hello world";
       int arg2 = 2;
       char *arg3 = "study";

       char *i18nfmt = "%1$s %3$d
";

       test(function_name, i18nfmt, arg1, arg2, arg3);
       }

       test(va_alist)
       va_dcl
       {
       va_list args;
       char *fmt;
       char string[1024];

       va_start(args);

       (void)printf("function %s: ", va_arg(args, char *));

       fmt = va_arg(args, char *);

       (void)vprintf(fmt, args);

       va_end(args);
       }

See Also
       setlocale(3), scanf(3int), printf(3s), printf(3int), vprintf(3s), putc(3s), scanf(3s), stdio(3s), varargs(3)
       Guide to Developing International Software

																     vprintf(3int)
All times are GMT -4. The time now is 05:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy