05-22-2008
Look at the printf command.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
no problem (6 Replies)
Discussion started by: angelina
6 Replies
2. Shell Programming and Scripting
Hi,
I am having trouble using the result of the following awk command in a script, as displaying the contents of the placeholder automatically replaces the new created TAB by a space character again:
From the prompt:
cscyabl@comet:(develop)> echo "01 12" | awk '{gsub(" ","\t");print}'
01 ... (2 Replies)
Discussion started by: Indalecio
2 Replies
3. Shell Programming and Scripting
I am having a lot of trouble, wasting a lot of time trying to get sed script files to run without problem. I have a list of scripts I want to run on a text file to turn it into a viewable html file for my mobile phone. Each of the single scripts when run in order/sequence one after another on the... (4 Replies)
Discussion started by: naphelge
4 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I need to run a command for a set of input variables that are present in a tab delimited file, a sample of which is shown below:
1 3749
1 4129
1 5980
2 6201
2 9925
2 6894
3 1338
3 6477
3 6242
3 3632
Every row represents the two input values... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
5. Shell Programming and Scripting
Hi all,
Currently i am using
if( $0~/ NOT / && $0~/ NULL /)
{
.................
}
to check if the input record contains "NOT" and "NULL". But in some cases "NOT" and "NULL" are preceded and followed by tab. How do i find compare for these fields as well? (3 Replies)
Discussion started by: ysvsr1
3 Replies
6. Shell Programming and Scripting
Hello,
I have this sentence :Pattern1 Pattern2 Pattern3 Pattern4-which-contains-HELLO-string-and-other-stuff-and-second-HELLO-and-third-HELLO
I want to delete everything between the 3rd tab (\t) and the FIRST pattern "HELLO" of the line.
Result expected is : Pattern1 ... (7 Replies)
Discussion started by: theclem35
7 Replies
7. UNIX and Linux Applications
Hi, perhaps this is a dumb question.
I'm running queries on mysql and I'm getting tabbed results like these:
mysql> SELECT * from metrics_status WHERE date = '2012-03-30';
<TABLE... (1 Reply)
Discussion started by: erick_tuk
1 Replies
8. UNIX for Dummies Questions & Answers
Hi
I have a number of sequences and a string occurs a number of times in that sequence.
How can I select and replace only those strings which are followed by \tab.
for eg :
my sequence looks like :
string0 positive cd parent=string0 id =121 string0
string0 negative ef parent=... (2 Replies)
Discussion started by: sonia102
2 Replies
9. Shell Programming and Scripting
Hi,
I have a String(words with tab space) in a file ->file1.txt
0xxxx 11 test $aa$ 8.43
when i read the file and assign to variable
value=$(cat file1.txt)
echo $value
i get the output without tab spaces.
0xxxx 11 test $aa$ 8.43
How to assign string... (2 Replies)
Discussion started by: nanthagopal
2 Replies
10. Shell Programming and Scripting
Hi ,
I am looking to print the whole string from file2.txt but it is only printing 77 but not the whole matched string from File2.txt Any help is appreciated.
Thanks,
Script
awk '
BEGIN {
OFS="\t"
out = "a.txt"}
NR==FNR && NF {a=$0; next}
function print_65_11() {
if... (11 Replies)
Discussion started by: High-T
11 Replies
LEARN ABOUT DEBIAN
explain_printf_or_die
explain_printf_or_die(3) Library Functions Manual explain_printf_or_die(3)
NAME
explain_printf_or_die - formatted output conversion and report errors
SYNOPSIS
#include <libexplain/printf.h>
int explain_printf_or_die(const char *format);
int explain_printf_on_error(const char *format);
DESCRIPTION
The explain_printf_or_die function is used to call the printf(3) system call. On failure an explanation will be printed to stderr, obtained
from the explain_printf(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_printf_on_error function is used to call the printf(3) system call. On failure an explanation will be printed to stderr,
obtained from the explain_printf(3) function, but still returns to the caller.
format The format, exactly as to be passed to the printf(3) system call.
RETURN VALUE
The explain_printf_or_die function only returns on success, see printf(3) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_printf_on_error function always returns the value return by the wrapped printf(3) system call.
EXAMPLE
The explain_printf_or_die function is intended to be used in a fashion similar to the following example:
int result = explain_printf_or_die(format);
SEE ALSO
printf(3)
formatted output conversion
explain_printf(3)
explain printf(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2010 Peter Miller
explain_printf_or_die(3)