So I have a program that allows the user to enter a file, change some characters (for example, a changes to t, etc.) and then save the new file under a new name. However, I need to press carriage return twice for the program to end. I was just wondering if anyone knew of a way for the user to specify the name of the file, for the outfile to be written and then the program to just end?
Here's what I have at the minute
After the user specifies the name of the new file and presses carriage return, they get brought onto a new, empty line and then must press carriage return again for the program to end. If anyone knows a way of doing this in one carriage return it would be much appreciated. If not then thanks for reading anyway
I have a file that comes in as 20081002_invoices.txt and needs to go out as
invoices(20081002).xls When ran this file should have three seperate fields as follows:
column1 column2 column3
data1 data2 data3
when i run the script it produces the invoices(20081002).xls but moves... (1 Reply)
Hi All,
I am very new in programming. I need some help.
I have one input file like:
Number of disabled taxa: 9
Loading mapping file: ncbi.map
Load mapping:
taxId2TaxLevel: 469951
--- Subsample reads (20%): 66680 of 334386
Processing: tree-from-summary
Running tree-from-summary... (21 Replies)
I`m having output file which contain following no which changes every time i run script.The number given below are there in file and i have to fatch them from file.
12
15
56
158
365
165
598
568
265
256
258
now i want to use above number from output to input as $j
r=`/omp/bin/ICIC... (1 Reply)
I'd like to do an if / else if condition and print to different files.
Something like:
awk '{
if ($1 == "yes") print $2, $4 < infile > outfile1 ;
else if ($1 == "No") print $2, $4 < infile > outfile2
}'
Obviously I don't know the syntax.
Thanks so much. (5 Replies)
Hello,
Compilation of the line "cout = outFile" throws error
"Error: std::ios_base::operator=(const std::ios_base&) is not accessible from std::ios ::operator=(const std::ios &)."
outFile is declared as "static ofstream".
Thanks,
Shafi (3 Replies)
Hi Everyone,
I have two files i.e. one file2 contains today's data and the other file1 contains Yesterday's data.
The data in the files contains 226 columns and the data for the coulums separated by a Pipe "|" delimiter.
Now, I have 4 Primary keys (coulumns) by which I have to compare file2 and... (10 Replies)
Hi
I am writing a perl script which checks for the specific column values from a file and writes to the OUT file.
So the feed file has a header information and footer information.
I header information isaround107 lines i.e.
Starts with
START-OF-FILE
.......
so on ....
... (11 Replies)
Hi,
I'm trying to use pyExcelerator's module "xls2csv" converter in ubuntu.
The following works great, except the standard out is in the terminal.
sudo python xls2csv.py test.xls
I want the csv delimited output to be redirected to a file. When I enter....
sudo python xls2csv.py test.xls... (5 Replies)
Hello,
Each time a user log on to host, they receive below error:
-sh: /tmp/outfile: cannot create
Example:
$ ssh host
user@host's password:
Last login: Fri Dec 4 08:17:28 2015 from client.ref
|-----------------------------------------------------------------|
-sh:... (2 Replies)
Good day, I am trying to run the following command but it does not seem to work.
# mysql -pPassword asteriskcdrdb -s -b -e "select 'Account ID','Destination','Operator','Provider','Date','BillSec','Rate id','Cost' UNION select accountcode,dst,'PBX',route_name,date_format(calldate,'%Y/%c/%e... (8 Replies)
Discussion started by: esgaroth32
8 Replies
LEARN ABOUT OSF1
basename
basename(1) General Commands Manual basename(1)NAME
basename, dirname - Returns the base file name or directory portion of a path name
SYNOPSIS
basename string [suffix]
dirname string
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
basename: XCU5.0
dirname: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
None
OPERANDS
A string to be evaluated. This string may be empty. A file name suffix to be deleted if found. This operand applies to the basename com-
mand only, and is optional.
DESCRIPTION
The basename command reads the string specified on the command line, deletes the portion from the beginning to the last / (slash), and
writes the base file name to standard output. If suffix is specified on the command line and suffix appears in string, the string is
returned with the suffix removed.
The dirname command reads the string specified on the command line, deletes from the last / (slash) to the end of the line, and writes the
remaining path name to standard output.
[Tru64 UNIX] The basename and dirname commands are generally used inside command substitutions within a shell procedure to specify an out-
put file name that is some variation of a specified input file name. For more information, see the csh(1), ksh(1), and sh(1b) or sh(1p)
reference pages.
The following table demonstrates the processing applied to characters with particular meanings by the basename and dirname commands.
------------------------------
basename dirname
string Result Result
------------------------------
/ / /
// / /
/a/b b /a
//a//b// b //a
<null> err msg err msg
a a .
"" .
/a a /
/a/b b /a
a/b b a
------------------------------
NOTES
It is not an error if suffix is not a part of string.
EXAMPLES
To display the base file name of a shell variable, enter: basename $WORKFILE
This displays the base file name of the value assigned to the WORKFILE shell variable. If WORKFILE is set to /u/gabe/program.c,
then program.c is displayed. To construct, in a shell script, a file name that is the same as another file name, except for its
suffix, enter the following command, using grave accents: OFILE=`basename $1 .c`.o
This assigns to OFILE the value of the first positional parameter ($1), but with its suffix changed to $1 is /u/jim/program.c, then
OFILE becomes program.o. Because program.o is only a base file name, it identifies a file in the current directory.
The grave accents perform command substitution. To construct the name of a file located in the same directory as another, enter the
following command, using grave accents: AOUTFILE=`dirname $TEXTFILE`/a.out
This sets the AOUTFILE shell variable to the name of an a.out file that is in the same directory as TEXTFILE. If TEXTFILE is
/u/fran/prog.c, then the value of dirname $TEXTFILE is /u/fran and AOUTFILE becomes /u/fran/a.out.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of basename and dirname: Provides a default value for the internationalization
variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the inter-
nationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-
empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of
sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the
locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the
processing of LC_MESSAGES.
SEE ALSO
Commands: csh(1), ksh(1), Bourne shell sh(1b), POSIX shell sh(1p)
Standards: standards(5)basename(1)