06-09-2009
Read a number from file and place it back
Hi All,
I want to read one number from the file.
Only one number will be there in the file.
then i have to increment the number in my script and put it back in the same file.
Is it possible?
Can anybody help me?
Thanks,
Vinay
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
I am a begginer in unix and i want to know how to open a file and read it and separate the numbers & words and storing it in separate files, Using shell scripting.
Please help me out for this.
Regards
S.Kamakshi (2 Replies)
Discussion started by: kamakshi s
2 Replies
2. Shell Programming and Scripting
Hello,
if I've a list of number
23
34
56
78
how I can place a sequence of ordinated number in a boundary column so
1 23
2 34
3 56
4 78
Thanks in advance! (3 Replies)
Discussion started by: cv313x
3 Replies
3. Shell Programming and Scripting
Hiii
I am very new to shell scripting.This is my data file
a.txt:
56
45.78
1000
11.23
76.89
45
34.56
23
3400
100
..........
Now i am must use shell scripting to read n number of lines from the file & from ts n number of lines i need to find greatest number among them & so on for... (44 Replies)
Discussion started by: varsha
44 Replies
4. UNIX for Dummies Questions & Answers
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Discussion started by: grc
5 Replies
5. Shell Programming and Scripting
Hello, I am using tcsh on AIX.
I would like to write a script that does the following:
1. given an inode, how do I find exactly the name of the file?
I know I could do this using ls -i | grep <inode>
but it returns: <inode> <filename>. I need some string manipulation or something to... (1 Reply)
Discussion started by: lastZenMaster
1 Replies
6. Shell Programming and Scripting
Hello,
I am trying to make a bash script that can pull data from a file and then change one part of said data.
I want to search by username and pull the full line. That way there is a way to replace just one part of that line then return it back to the file.
My Data is stored like:
... (1 Reply)
Discussion started by: serverfull
1 Replies
7. Shell Programming and Scripting
Hi,
This is most likely a dumb question but I could not find answer to it elsewhere.
I'm building a simple menu with case /esac and want to read user's input:
Please enter XYZ ; read XYZ
How do I take the value of XYZ and insert it as a variable $XYZ in file file.txt ?
I may need to... (9 Replies)
Discussion started by: svetoslav_sj
9 Replies
8. Shell Programming and Scripting
hello guys,
I'm struggled to get a number from a very long text file.
NAtoms= 33 NActive= 30 NUniq= 23 SFac= 1.00D+00 NAtFMM= 60 NAOKFM=F Big=F
Integral buffers will be 131072 words long.
Raffenetti 2 integral format.
The number 33 is what I wanted, always follows NAtoms=... (5 Replies)
Discussion started by: liuzhencc
5 Replies
9. Shell Programming and Scripting
Hi I was hoping someone could help me with a sed script I am trying to write? I am on a Mac running ElCapitan
I have some text that I have converted from a pdf that I want to format into an xml file.
In the file I have managed to delete all the text I do not need. The text I have left is... (8 Replies)
Discussion started by: Paul Walker
8 Replies
10. UNIX for Beginners Questions & Answers
I'm new with sed, and i am really confused with slashes, backslashes, parentheses, I've tried reading some beginner's guide, but still trouble fixing this problem, do you have any tips where or what to read to learn more about sed? can you also help me with my problem?
Note: I was tasked to use... (4 Replies)
Discussion started by: akopocpoypoy
4 Replies
LEARN ABOUT DEBIAN
a5booklet
A5BOOKLET(1) General Commands Manual A5BOOKLET(1)
NAME
a5booklet - copy two A5 pages from a .dvi file to one A4 page in another.
SYNOPSIS
a5booklet file[.dvi]
DESCRIPTION
A5booklet is a little script that allows you to typeset two A5 pages next to eachother on a single A4 page (landscape), combining pages
from the original file in such a way that after double sided printing and some reshuffeling of the pages you get a nice a5 booklet that is
ready for a staple in the middle.
The script calls a very clever program dvidvi, written by Tomas Rokicki (the author of dvips), that does the real work.
The output is written to two files, file-1.dvi and file-2.dvi
dvips -ta4 -tlandscape file-1
then put the stack upside doen in the printer, and print the second file using
dvips -ta4 -tlandscape file-2
Make sure that the bottom of the A5-pages is on the correct side of the paper when you put the stack back for printing the back side.
After the two print jobs, you must re-shuffle the paper stack before you can staple it.
SEE ALSO
tex(1), dvips(1), dvidvi(1).
BUGS
The script has A4 papersize hardwired into it. Admittedly, a European-centered way of thinking.
Page number 1 is always the first page in the original .dvi file, not the page numbered 1 by TeX's numbering scheme.
AUTHOR
A5booklet is written by David A. van Leeuwen (david@ElseWare.cistron.nl), but is is not original in any way. The main two lines that do
the work are inspired from the man page of dvidvi. A5booklet is available under the conditions of the Gnu Public Licence.
OCTOBER 1997 A5BOOKLET(1)