06-17-2007
can use awk
Hi,
I think you can use AWK.(I am a newer also)
awk 'BEGIN{
i=1
}
{var[++i]=$0}
END{
for (a in var)
print var[a]
}'
Pls try!
This User Gave Thanks to summer_cherry For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Dear friends,
i am writing csh script
i have one dat file containing following data.like this.
08FD3 03A26 000FA0 FFFF0 BBA0F 00000 00000
from the above file i want to read each letter and store it in one variable.
how it is possible.
please help (7 Replies)
Discussion started by: rajan_ka1
7 Replies
2. Shell Programming and Scripting
i have to store the files in a folder and assign a variable to the the files. (0 Replies)
Discussion started by: dineshr85
0 Replies
3. UNIX for Dummies Questions & Answers
Hi,
How to read a file and put the values in a script. E.g.
file1.txt
02/12/2009;t1;t2
The script should read this file and put these values in 3 different variables x1,x2,x3 which can be used further.
Thanks
Ashu (3 Replies)
Discussion started by: er_ashu
3 Replies
4. Shell Programming and Scripting
Hi,
How to read xml tag attributes and store into variable in shell script?
Thanks,
Swetha (5 Replies)
Discussion started by: swetha123
5 Replies
5. Shell Programming and Scripting
Friends,
I have a file output.txt with values as below:
092307135717
061910135717
I want to know how to read this file and then assign each value to a variable.
say like
var1=092307135717
var2=061910135717
So that I can use this VAR1 and Var2 in the shell script for further processing.... (3 Replies)
Discussion started by: shyamaladevi
3 Replies
6. Shell Programming and Scripting
Hi Gurus,
I am trying for a scenario where in I want to read the contents of a file line by line and then store them in variables. Below is the script:
#!/bin/ksh
while read line
do
id=`echo $line | cut -f1 -d |`
name=`echo $line | cut -f2 -d |`
echo $id
... (11 Replies)
Discussion started by: svajhala
11 Replies
7. Shell Programming and Scripting
Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files.
all my parameters files are in the same directory, so pick them up with
ls *.para >>dirafter that I have a dir file like that:
param1.para
param2.para
etc...
I... (2 Replies)
Discussion started by: shadok
2 Replies
8. Shell Programming and Scripting
Hi,
I would like to read a file line by line and then store the whole line word by word in array so that I can do specific manipulation on each word.
$ cat test.txt
hello how are you
i am good
I would like to have an array created dynamically so that first time , the... (4 Replies)
Discussion started by: ashwin3086
4 Replies
9. Shell Programming and Scripting
Hi,
I have a file service.xml which has following content:
<?xml version="1.0" encoding="UTF-8"?>
<Service Ver="2.31.13"/>
I want to read the value of Ver (that is 2.31.13) and assign to a variable which i further use.
Please help me in that. (3 Replies)
Discussion started by: laxmikant15
3 Replies
10. Shell Programming and Scripting
Hello,
I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop ,
while IFS=: read -r line
do
set $dsc=$line
echo 'printing line variable ' $line... (1 Reply)
Discussion started by: ParthThakkar
1 Replies