Programming :: Print A Value To A File ?
Apr 12, 2010I have this code:
How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.
I have this code:
How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.
I want to write a script that returns me name of the files that begin with the specified characters. like
Script out should be
why this code can't print in the while loop the content of the file ?
Code:
#include <stdio.h>
int main()
{
FILE *fp;
[code]...
I am using an awk command to print a line from a cvs file.the awk command includes an if statement that filter the output-lets say i want to print all the lines that the price field is greater than 30.i have it working when i put the parameters myself.. but when i try to send them with vars it wont work..i am sending the sign of the if statement - can only be: == , < , >it looks like this:
cat file.csv | awk -v sign=">" -v field="2000" '{if($3 sign field) printf "%-12s%-12s%-12s%-12s
",$1,$2,$3,$4}' FS=,
the bold part is the problem , because when i put the sign parameter myself t works great.. i guess its a chars issue but i cant spot it
I having the following awk line in a script, is it possible to modify the script so that it create a the directory if it dosnt exist (similar to mkdir -p) awk -v datum="$DATUM" -v workingdir="$workingdir" '{ sub("\[.*","",$5); print > workingdir"/"datum "/" $5;}' $1
View 1 Replies View RelatedHow to write a shell script the would search for a phone no using at the end text file using sed or awk and store it in a varaible or print it.
The text file is in this form
The first line may take any form but the last line will always be Firstname Lastname:KEN:+254456789
I would like to seach for the Phone and store it in a variable and print it.
The phone no will alway be preceeded by ":+"
How do I do this?The script below obviously dosn't work.
#!/bin/bash
for u in $(awk '{print $2}' user.txt)
for i in $(awk '{print $1}' user.txt)
[code]...
One text file with two columns in it, I need to iterate through the file and print the different columns each time
I am trying to compare a list of patterns from one file and grep them against another file and print out only the unique patterns. Unfortunately these files are so large that they have yet to run to completion. Here's the command that I used:
Code: grep -L -f file_one.txt file_two.txt > output.output Here's some example data:
Code:
>FQ4HLCS01BMR4N
>FQ4HLCS01BZNV6
>FQ4HLCS01B40PB
>FQ4HLCS01BT43K
>FQ4HLCS01CB736
>FQ4HLCS01BU3UM
>FQ4HLCS01BBIFQ
how to increase efficiency or use another command?
I have a problem when using awk:
e.g: awk '{processing text}' File1 > File2
But when I'm processing the File1, I want to print out some messages to the screen (not the File2). How can I do that?
How can I print the current time of my system with a batch file. My os is ubuntu.
View 4 Replies View RelatedI have a problem with arrays in awk. What i want is to take some data from a file (ssh log) and print it to a html table. I have managed to print some stuff (user logged in and how many times they have logged in) What i want more is to take all the ip that each user logged in from and print it in a row next to the username and times (in the code i typed blabbla where i want the ip to be shown. How do you think i should approch that, multidimensional arrys maybe?
Code:
Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.
As an example : I have text file with orders and returns :
Item2-SKU-2-11.08.2010-online
Item3-SKU-3-11.09.2010-return
Item4-SKU-4-11.09.2010-store
My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)
Just installed drivers for Lexmark pro200 - S500 series. However although it is recognised by the system and has a tick by its name, And tells me it is connected via usb file goes to print que but will not print. Also tells me it is Printing - localhost! is this correct?.
View 1 Replies View RelatedI have a debian system installed on my pc . I have just saved a text file on my desktop . Please let me know how can i print the file through comand prompt ? I need to learn the printing the file thru comamnd line .
View 1 Replies View RelatedHere we go, error 4,384,239,283 in Ubuntu I was trying to load a PDF and print it and only said "print to file" So I go to System >Administration>Printing, and it says "Starting Printing." at the bottom, and then goes away... Sigh, anyone knows whats going on?
View 5 Replies View RelatedI'm trying to setup a print server in Fedora 13. I've made it using CUPS and when I send something to print from a Windows PC it goes ok. My main concern is to know where is the spool file stored when a file is sent to print. I've seen in many forums that it is stored in /var/spools/cups. What I only see here is a file name c000XXX with some information about the printing job. I'm using hold print for this printer and before printing out anything I can't find the spool. I've tried cups-pdf and it stores a pdf file in a route but this is not enough for me. I need to know where the spool data is stored in order to know from who is the job being send.
View 1 Replies View RelatedI want to configure file printer (print to file) on my rhel-5 machine in such a way that if users fire print command from windows xp it should create an individual computer wise txt file on my linux machine. File name should be different for each printer.
View 2 Replies View RelatedI want to print NaN value in a file containing of 3600 rows and 7 columns.The illustration of output file which I want to is as follows :
NaN NaN NaN NaN NaN NaN NaN (the first row)
NaN .... NaN
.
.
.
NaN .... NaN (the 3600 rows)
I tried to use below command
awk 'BEGIN {for(i = 1; i <= 3600; i++); printf "%s", "NaN", $1" "$2" "$3" "$4" "$5" "$6" "$7}' > output
Unfortunately, I couldn't get what I want to.
Say I have a line like such:
Code:
today 2010 Feb 21 test10, 12AM
How would I print everything AFTER "2010 Feb 21 "?
What I thought to do so far is to set a variable to the format used in the string like so:
Code:
date="$(date +%Y %b %e)"
So I know I have to use either awk, sed, or perhaps bash substrings to work with the variable $date, but as to how, I'm drawing a blank.
problem statement:
pattern_search="Exam Name"
sed -n "/$pattern_search/,/hello/"p tmp5 | awk '{if ( $4 != 0 && $4 ~ /[0-9]+.*[0-9]*/ ) print "$pattern_search" " " $0 }'
"tmp5" is a file. this is printing output as
$pattern_search value1
i.e value of $pattern_search is not getting substituted. i am expecting output as
Exam Name value1
I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:
if ($_POST['password'] == $password) {
then do whatever
}
else { print "Wrong password" ; )
My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -
if ($_POST['password'] == $password) {
then do whatever
}
[code]....
I've just started programming at my university and I'm finding it a bit hard to get started. I've been given this for homework.Given 2 integers, a and b, print their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just print 20The problem I'm having is that i don't know how to tell java to print 20 when the value is in that range.
View 14 Replies View RelatedAny one using php program to direct lpt port print command, now i am creating one programe for mini shope that system having citizen CT-S4000 model.
View 2 Replies View Relatedi want to print all ASCII characters kind of like a table, but i really don't have an idea of how to do it, i don't know if there is a built-in method or something to accomplish this, if not
View 2 Replies View RelatedI am trying to write a program that monitors when an lp or basically any sort of print command is issued. If a print command is detected I want to pause that job and ask the user if he / she wants to continue.
This program would run in the background all the time so it can't sit and eat up a lot of cpu. I tried a simple while loop that continuously monitored "ps" and that obviously boosted my cpu to 100%.
how do i combine these two lines to output all network interfaces on my machine?
View 1 Replies View RelatedI am just trying to run the following piece of awk code. But it doesn't print anything. where I am doing wrong?
[code]...
I've been working on it for over 20 hours and I'm stuck. It asks the user for input and then prints a shape of a certain length.
View 4 Replies View RelatedWhat's the difference between PHP echo() and PHP print(), especially in the execution time?
View 6 Replies View RelatedI need some direction on a small scripting question. I've been doing some development and storing the code on a network drive with multiple user access. My development is getting complex enough that it is time to set up a svn repo for it. I would like to set up a little script (if possible) that prints a message/reminder to whomever is accessing the code directory stating that the code is ultimately stored in svn and any changes need to be checked in, etc. Is there a way to have linux print a message to the screen based on a 'cd /specific_dir/' command? So far google is mum on the topic. Using Debian and bash shell.
View 5 Replies View Related